Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Ian Puleston <ian-yuLBrIJrOA1t7w4Cp29DLCzB60oRJSow <at> public.gmane.org>
Subject: mingw-runtime 3.15 - stdlib.h with -ansi is broken
Newsgroups: gmane.comp.gnu.mingw.user
Date: Tuesday 7th October 2008 16:17:26 UTC (over 9 years ago)
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 
#include 
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
[email protected]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
 
CD: 3ms