V3 PATCH: #undef some C99 math macros in <cmath>

Nathan Myers ncm@nospam.cantrip.org
Thu Apr 5 22:29:00 GMT 2001


On Thu, Apr 05, 2001 at 07:53:53PM -0700, Ulrich Drepper wrote:
> You'll have to face it: the C++ people screwed up big time by not
> looking forward to C99 and in advance making decisions about the
> extensions.  

I take it this is flamebait.  Nonetheless...

The C++ committee were unanimously interested in maintaining
compatibility with C.  The C committee, on the other hand
(with honorable exceptions), expressed a vehement lack of 
interest in any cooperation with the C++ group.  Without the 
cooperation of the C committee, no coordination was possible.  

As it turned out, the C committee gleefully introduced 
incompatibilities after C++ was frozen.  It's a good thing 
the C++ committee didn't try to track them; things could have 
turned out far worse.  By sticking to the C89 standard, the 
C++ committee was able to minimize incompatibilities to the 
degree that the C committee was unwilling to break C programs.

Where does this leave us?  Putting the extra symbols in std::iso_c99::
is probably safe.  Providing something like

  #ifdef _ISO_C99_SOURCE
    namespace std { using namespace ::std::iso_c99; }
  #endif

so that users can deliberately choose to import the symbols to std::
seems to make things easier on some people, at some acknowledged risk.    

Nathan Myers
ncm at cantrip dot org



More information about the Libstdc++ mailing list