[Scummvm-tracker] [ScummVM :: Bugs] #6988: COMPILER: --enable-c++11 breaks compilation in commandline.cpp (AmigaOS4) (was: COMPILER: --enable-c++11 breaks compilation of commandline.cpp (AmigaOS4))

ScummVM :: Bugs trac at scummvm.org
Fri Jul 10 11:30:59 UTC 2020


#6988: COMPILER: --enable-c++11 breaks compilation in commandline.cpp (AmigaOS4)
----------------------+----------------------------
  Reporter:  raziel-  |      Owner:  sev-
      Type:  defect   |     Status:  closed
  Priority:  normal   |  Component:  Port: AmigaOS4
Resolution:  fixed    |   Keywords:
      Game:           |
----------------------+----------------------------
Changes (by raziel-):

 * owner:  (none) => sev-
 * status:  new => closed
 * resolution:   => fixed
 * summary:
     COMPILER: --enable-c++11 breaks compilation of commandline.cpp
     (AmigaOS4)
     =>
     COMPILER: --enable-c++11 breaks compilation in commandline.cpp
     (AmigaOS4)


Old description:

> {{{#!Markdown
> 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>
> #include <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
> }}}
> {{{#!div style="font-size: 75%"
> Ticket imported from: bugs/6988.
> }}}

New description:

 Using the flag
 {{{
 --enable-c++11
 }}}
 with configure, makes the compiler error early 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>
 #include <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

 {{{#!div style="font-size: 75%"
 Ticket imported from: bugs/6988.
 }}}

--
Comment:

 Fixed by
 https://github.com/scummvm/scummvm/commit/a7a11c3fde915ff5c203f13ded8b553610d5a928
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/6988#comment:9>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list