Hi Paolo,
>> I guess the patch is ok now?
>
> Yes. Nice that Jon replied in the meanwhile and clarified the undefined
> behavior issue: for the time being I think we can keep the __cplusplus
> checks, should also help during this testing period. We can certainly clean
> up the thing later. Maybe you could add a comment somewhere summarizing what
> Jon wrote.
for the moment, I've installed the patch as is. It's probably better to
add some statement along those lines to user docs (and mention the
change in gcc-4.7/changes.html :-)
Btw., I just noticed the following in Oracle Studio 12.3 Beta CC(1):
-features=a
Enables/disables various C++ language features.
The following table lists the -features suboption key-
words and their meanings. The prefix no% applied to a
suboption disables that suboption.
Value Meaning
[...]
cplusplus_redef
Allow the normally pre-defined macro __cplusplus
to be redefined by a -D option on the command
line. Attempting to redefine __cplusplus with a
#define directive in source code is not allowed.
Example:
CC -features=cplusplus_redef -D__cplusplus=1 ...
The g++ compiler typically predefines the
__cplusplus macro to 1, and source code might
depend on this non-standard value. (The standard
value is 199711L for compilers implementing the
1998 C++ standard or the 2003 update. Future stan-
dards will require a larger value for the macro.)
Do not use this option unless you need to redefine
__cplusplus to 1 in order to compile code intended
for g++.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University