[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug report: Compile with Microsoft and Intel compiler
From: |
Eli Zaretskii |
Subject: |
Re: Bug report: Compile with Microsoft and Intel compiler |
Date: |
Fri, 29 Apr 2005 10:38:18 +0300 |
> From: =?iso-8859-1?Q?Jerker_B=E4ck?= <address@hidden>
> Cc: <address@hidden>
> Date: Fri, 29 Apr 2005 05:31:40 +0200
>
> You asked for the real prototypes - here they are:
>
> These functions are defined in the runtime library and cannot be defined
> again unless EXACTLY identical stated. All local defines of these functions
> MUST therefore be disabled. Otherwise we get a fatal error 2373. How you
> previously got MSC by this is mysterious.
??? Sorry, I'm mightily confused. What do you mean by ``defined in
the runtime library''? A library does not, AFAIK, include any
declarations of function's prototypes. It includes _their_code_.
Next, what do you mean by ``local defines'', and what is that "fatal
error 2373"? E.g., can you compile, link, and run the following toy
program (which is a simplified replacement for the CHDIR command)?
-------------------------------------------
_CRTIMP int __cdecl _chdir(const char *);
int main(int argc, char *argv[])
{
if (argc > 1)
_chdir(argv[1]);
return 0;
}
-------------------------------------------
If this compiles at the highest possible warning level and runs and
expected, why can't we throw together a unistd.h and use it? What am
I missing?
>
> List of redefines causing errors
>
> Func Microsoft Borland
> --------------------------------
> chdir <direct.h> <dir.h>
> dup2 <io.h> <io.h>
> environ <stdlib.h> <stdlib.h>
> execve <process.h> <process.h>
> _exit <stdlib.h> <stdlib.h>
> getcwd <direct.h> <dir.h>
> getenv <stdlib.h> <stdlib.h>
> getpid <process.h> <process.h>
> mktemp <io.h> <io.h>
> strerror <string.h> <string.h>
>
> (Borland also have direct.h)
>
> Microsoft default prototypes:
> ------------------------------
> _CRTIMP int __cdecl _chdir(const char *);
> _CRTIMP int __cdecl _dup2(int, int);
> _CRTIMP extern char ** _environ;
> _CRTIMP int __cdecl _execve(const char *, const char * const *, const char *
> const *);
> _CRTIMP __declspec(noreturn) void __cdecl _exit(int);
> _CRTIMP char * __cdecl _getdcwd(int, char *, int);
> _CRTIMP int __cdecl _getpid(void);
> _CRTIMP char * __cdecl _mktemp(char *);
> _CRTIMP char * __cdecl _strerror(const char *);
> _CRTIMP char * __cdecl strerror(int);
I need to see how it defines chdir, dup2, environ, getpid, and mktemp,
without the leading underscores.
Also, what is the precise definition of _CRTIMP?
> there is also prototypes for oldnames.lib functions
> (no underscore function aliases)
Please show these aliases.
> Note: To make it even more complicated you're normally using the
> UNICODE/MBCS safe defines in tchar.h
>
> Ex:
> MBCS defined:
> #define _tchdir _chdir
But Make doesn't use _tchdir, does it? So we could safely forget
about this complication.
> So, if you plan what I think you're planning - don't, it's not a good idea.
??? Please explain why. Especially since MinGW, evidently, uses
similar techniques to create its version of unistd.h, as Earnie told
us just now.
- Re: Bug report: Compile with Microsoft and Intel compiler, (continued)
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/27
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/28
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/28
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/28
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/28
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/28
- Re: Bug report: Compile with Microsoft and Intel compiler,
Eli Zaretskii <=
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/29
- RE: Bug report: Compile with Microsoft and Intel compiler, Jerker Bäck, 2005/04/29
- RE: Bug report: Compile with Microsoft and Intel compiler, Paul D. Smith, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Paul D. Smith, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/29
- Re: Bug report: Compile with Microsoft and Intel compiler, Alessandro Vesely, 2005/04/28
- Re: Bug report: Compile with Microsoft and Intel compiler, Eli Zaretskii, 2005/04/28