Opened 5 years ago

Last modified 5 years ago

#13252 new Bugs

Bootstrap.bat gcc throws compilation error (code is not c90 complilant)

Reported by: carlos.federico005@… Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:

Description

Trying to compile the new Boost 1.65.1 with Mingw w64 (gcc 4.8.3) on a Windows 10.

While running bootstrap.bat gcc I get:

...
 \boost_1_65_1\tools\build\src\engine>.\bootstrap\jam0 -f build.jam
 --toolset=gcc "--toolset-root= "   
 ...found 161 targets... 
 ...updating 3 targets... 
 [MKDIR] bin.ntx86_64 
 [COMPILE] bin.ntx86_64\b2.exe
 debugger.c: In function 'debug_start_child': 
 debugger.c:1128:5: error:
 'for' loop initial declarations are only allowed in C99 mode
      for ( int i = 1; i < argc; ++i )
      ^
 debugger.c:1128:5: note: use option -std=c99 or -std=gnu99 to compile your code 
 strings.c: In function 'string_rtrim':
 strings.c:195:5: warning: ISO C90 forbids mixed declarations and code
 [-Wpedantic]
      char * p = self->value + self->size - 1;
      ^
 ...

So making a small modification (declare the i variable outside the for-loop) into boost_1_65_1\tools\build\src\engine\debugger.c:1128 I can make it compile perfectly.

I guess adding --std=c99 or --std=c11 into boost_1_65_1\tools\build\src\engine\config_toolset.bat:204 could been even better.

Change History (1)

comment:1 by anonymous, 5 years ago

Not sure if it is important to mention, but this applies to version 1.65.1 as well. I encountered this problem today.

Note: See TracTickets for help on using tickets.