lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
***BOGO*** [Mingw-users] mingw-runtime 3.15 - stdlib.h with -ansi is broken
- Date: Tue, 7 Oct 2008 09:17:26 -0700
- From: "Ian Puleston" <ian@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: ***BOGO*** [Mingw-users] mingw-runtime 3.15 - stdlib.h with -ansi is broken
Hi,
The declarations of strtod, strtof, strtol and strtold in stdlib.h have
changed between the 3.14 and 3.15 releases of mingw-runtime, and the new
ones will not compile with the -ansi option. This simple program
demonstrates it:
[Temp]: cat tst2.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf ("Hello\n");
return 0;
}
[Temp]: gcc -ansi tst2.c
In file included from tst2.c:2:
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/../../../../include/stdlib.h:317:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'double'
The line that it is complaining about is this declaration of strtod which
was changed to be an inline function between mingw-runtime 3.14 and 3.15:
inline double __cdecl __MINGW_NOTHROW strtod (const char* __restrict__
__nptr, char** __restrict__ __endptr) { return __strtod(__nptr, __endptr); }
The problem, of course, is that ANSI requires __inline__ and does not allow
'inline'. However changing "inline" to "__CRT_INLINE" makes that particular
problem go away, but instead it gives this:
c:\mingw\bin\../lib/gcc/mingw32/4.3.0/../../../../include/stdlib.h:320:
error: multiple storage classes in declaration specifiers
And if I comment out that line I get the same error reported for strtof,
etc.
Is this a known problem?
Ian
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users