Menu

#6988 AMIGAOS4: --enable-c++11 breaks compilation of commandline.cpp

*None
open
nobody
None
5
2016-01-01
2015-12-28
No

Using the flag --enable-c++11 with configure makes the compiler break with an error early on in commandline.cpp.

C++      base/commandLine.o
base/commandLine.cpp: In function 'void Base::usage(const char*, ...)':
base/commandLine.cpp:162:36: error: 'vsnprintf' was not declared in this scope
  vsnprintf(buf, STRINGBUFLEN, s, va);
                                  ^
gmake: *** [base/commandLine.o] Error 1

The same (or at least something similar) happens when using the flag -std=c++11
on a test program.

include <stdio.h></stdio.h>

include <stdarg.h></stdarg.h>

void test() { va_list ap; vsnprintf(0, 0, 0, ap); }

Building it with
g++ -c -o test.o test.cpp works fine, but adding the c++11 flag and using
g++ -c -o test.o test.cpp -std=c++11 throws this error

test.cpp: In function 'void test()':
test.cpp:5:48: error: 'vsnprintf' was not declared in this scope
void test() { va_list ap; vsnprintf(0, 0, 0, ap); }
^

AmigaOS4 - PPC - SDL - BE
GCC (adtools build 5.3.0) 5.3.0

Discussion

  • Johannes Schickel

    Looks like a broken toolchain. vsnprintf is part of C++11 (see: http://en.cppreference.com/w/cpp/io/c/vfprintf).

    You might need to update your C library's development headers.

     
  • Johannes Schickel

    • summary: COMPILER: Using --enable-c++11 breaks in commandline.cpp --> AMIGAOS4: --enable-c++11 breaks compilation of commandline.cpp
     
  • Anonymous

    Anonymous - 2016-01-01

    Not broken, it seems it's not yet supported: https://github.com/sba1/adtools/issues/6#issuecomment-168327141

    Probably can be closed then