[ scummvm-Bugs-3615056 ] Fix build with --enable-c++11 on FreeBSD

SourceForge.net noreply at sourceforge.net
Fri Sep 27 17:24:56 CEST 2013


Bugs item #3615056, was opened at 2013-09-27 08:24
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=3615056&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler error
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix build with --enable-c++11 on FreeBSD

Initial Comment:
On FreeBSD, the definition of NULL depends on the version of the C++ standard used. When building C++03 code, NULL is defined to 0. When building C++11 code, it is defined to nullptr instead. This behaviour is allowed by the standard.

ScummVM has a couple pieces of code, where a null pointer is being cast to an integer type. When building ScummVM as C++03, this works, as it simply yields integer 0. In C++11 mode, this causes the build to fail.

Furthermore, there are several pieces of code in ScummVM that use anonymous structs/unions. This causes Clang to print compiler warnings, as anonymous structs/unions are not part of the standard. This is not addressed by this patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=3615056&group_id=37116




More information about the Scummvm-tracker mailing list