X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: "Ian Puleston" To: Subject: stdlib compile error with -ansi and -mno-cygwin Date: Mon, 6 Oct 2008 12:21:38 -0700 Message-ID: <008301c927e8$c45f0fb0$4d1d2f10$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 #include 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/