delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/06/15:23:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Ian Puleston" <ian AT underpressuredivers DOT com>
To: <cygwin AT cygwin DOT com>
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
X-Mailer: Microsoft Office Outlook 12.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019