#1287 stdlib.h incorrect when gcc uses -ansi switch

INSTALLER
closed
Earnie Boyd
None
fixed
Invalid_mingw.ini
2013-01-30
2009-04-24
Peter Ross
No

The following very simple program fails to compile with the -ansi switch

test.c:
-----------------------------------------
#include <stdlib.h>
-----------------------------------------

# gcc -ansi test.c
In file included from test.c:1:
c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:317: error: s
yntax error before "double"

I'm using gcc 3.4.5 on a msys shell.

# gcc -v
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi
th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis
able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d
isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with
out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl
e-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

# uname -a
MINGW32_NT-5.0 WIN2K 1.0.11(0.46/3/2) 2009-01-29 00:39 i686 Msys

Discussion

  • Peter Ross
    Peter Ross
    2009-04-27

    If you change the inline keyword to __inline on line 317 then this file compiles. This is how stdlib.h is defined in the cygwin mingw package.

     
  • Earnie Boyd
    Earnie Boyd
    2009-04-27

    And since the Cygwin MinGW runtime and the MinGW runtime are one in the same you might try updating your mingwrt version.

     
  • Earnie Boyd
    Earnie Boyd
    2009-04-27

    • milestone: --> 102882
    • status: open --> pending-fixed
     
  • Keith Marshall
    Keith Marshall
    2009-04-28

    As Earnie says, you should update mingwrt.

    This is *at least* the third duplicate report of this bug; it was fixed *six months* ago! As of mingwrt-3.15.2, this bug is no longer an issue.

     
  • Keith Marshall
    Keith Marshall
    2009-04-28

    • labels: 103944 --> 104601
    • milestone: 102882 --> 516468
    • status: pending-fixed --> closed-fixed
     
  • Peter Ross
    Peter Ross
    2009-04-28

    Sorry for the duplicate bug report.

    I actually assumed I was at the latest mingw runtime. As I had only earlier that day installed mingw using the automatic installer, so I assumed incorrectly that it would get the latest version of the runtime, hence the bug report.

     
  • Earnie Boyd
    Earnie Boyd
    2009-04-28

    • labels: 104601 --> MinGW Installer
    • milestone: 516468 --> Invalid_mingw.ini
    • priority: 5 --> 9
    • assigned_to: nobody --> earnie
    • status: closed-fixed --> open
     
  • Earnie Boyd
    Earnie Boyd
    2009-04-28

    So the problem is the site update for a newer mingw.ini. Of course the developer uploading the files must also update the mingw.ini file. I'll make sure a process is in place to update the mingw.ini file today.

     
  • Earnie Boyd
    Earnie Boyd
    2009-04-28

    I've installed a crontab process to update the mingw.ini on the server. We now need those that care for packages to update the mingw.ini in CVS. The crontab process executes once every four hours at 15 minutes past the hour.

     
  • Earnie Boyd
    Earnie Boyd
    2009-04-28

    • status: open --> open-accepted
     
  • Earnie Boyd
    Earnie Boyd
    2009-05-04

    • status: open-accepted --> closed-accepted
     
  • Earnie Boyd
    Earnie Boyd
    2009-05-04

    Actions have been taken to correct the installer issue.

     
  • Earnie Boyd
    Earnie Boyd
    2013-01-30

    • labels: MinGW Installer -->
    • status: closed-accepted --> closed
    • resolution: --> fixed
    • category: --> Invalid_mingw.ini
    • milestone: Invalid_mingw.ini --> INSTALLER