[Scummvm-devel] ATTN Porters: Tests for the new C++ standards

Marcus Comstedt marcus at mc.pp.se
Sun May 31 08:54:05 UTC 2020


Hello everyone.

So, while testing with the --enable-c++11 flag, I discovered an
intricate problem.

The Scumm engine uses snprintf and vsnprintf.  Newlib does have these
functions, but it hides them when --std=c++11 is specified.  It
does this because __STRICT_ANSI__ is being set, but __STDC_VERSION__
is not set to 199901 or higher (because we are compiling C++, not C).

C++11 did, in fact, include these two functions, something that the
Newlib version I'm using is probably just too old to realize (it was
released before 2011, after all).  However, we are currently using
these function also when not targeting C++11.  Should we consider this
an error, and replace these with some wrapper of our own?

And if not, would it be ok to build with -std=gnu++11 instead of
-std=c++11, so that __STRICT_ANSI__ is not defined?

Thoughts?


  // Marcus




More information about the Scummvm-devel mailing list