From: Ian P. <ia...@un...> - 2008-10-07 16:18:11
|
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 |