Is there a good reason why this program compiles under GCC even with the -ansi
and -pedantic
flags?
#include
int mai
I believe that the Standards specify what symbols are required to be defined and in which header they are defined. I do not believe that the Standards state that no other symbols may be defined. More to the point, std::round()
will not be defined by a free symbol called round()
can be defined.
I might be off base here but doesn't gcc's -ansi flag apply to the code constructs (ie, disable GCC language extensions) rather than switching all libraries into strict ANSI compliant mode as well?
This is a bug. It's been around for a surprisingly long while. Apparently, there has not been enough of a collective desire to fix it. With a new version of C++ just around the corner which will adopt the C99 functions from math.h, it seems unlikely it will ever be fixed.