This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

stdlib compile error with -ansi and -mno-cygwin


Hi,

Having recently upgraded my Cygwin installation to the latest release, a
program that was compiling fine in now failing with a compile error reported
in stdlib.h. After a bit of digging, it turns out that stdlib.h does not now
compile with -ansi and -mno-cygwin options as it used to. 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
[Temp]: gcc -mno-cygwin tst2.c
[Temp]: gcc -ansi -mno-cygwin tst2.c
In file included from tst2.c:2:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/stdli
b.h:317: error: syntax error before "double"
[Temp]: gcc --version
gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The line that it is complaining about is this declaration of strtod:

inline double __cdecl __MINGW_NOTHROW strtod (const char* __restrict__
__nptr, char** __restrict__ __endptr)
{ return __strtod(__nptr, __endptr); }

And changing "inline" to "__CRT_INLINE" makes that particular problem go
away, but instead it gives this:

/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/stdli
b.h:321: error: multiple storage classes in declaration of `strtod'

Is this a known problem?

Ian




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]