[Bug libstdc++/11196] parse error before numeric constant <M_PI is defined in C++>

gcc-bugzilla at contacts dot eelis dot net gcc-bugzilla@gcc.gnu.org
Tue Nov 13 18:42:00 GMT 2007



------- Comment #7 from gcc-bugzilla at contacts dot eelis dot net  2007-11-13 18:42 -------
(In reply to comment #6)
> The bug is that the C++ front end implicitly #defines _GNU_SOURCE. 
> [..]
> Could some libstdc++ guru explain why this define is actually needed? 

I am no libstdc++ guru, but this:

  echo "#include <cstdlib>" | g++ -x c++ -U _GNU_SOURCE -c -

produces:

  /usr/include/c++/4.1.2/cstdlib:162: error: ‘::lldiv_t’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:168: error: ‘::_Exit’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:175: error: ‘::llabs’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:177: error: ‘lldiv_t’ does not name a type
  /usr/include/c++/4.1.2/cstdlib:181: error: ‘::lldiv’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:196: error: ‘::strtof’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:197: error: ‘::strtold’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:203: error: ‘__gnu_cxx::lldiv_t’ has not
been declared
  /usr/include/c++/4.1.2/cstdlib:205: error: ‘__gnu_cxx::_Exit’ has not
been declared
  /usr/include/c++/4.1.2/cstdlib:208: error: ‘__gnu_cxx::llabs’ has not
been declared
  /usr/include/c++/4.1.2/cstdlib:209: error: ‘__gnu_cxx::div’ has not been
declared
  /usr/include/c++/4.1.2/cstdlib:210: error: ‘__gnu_cxx::lldiv’ has not
been declared
  /usr/include/c++/4.1.2/cstdlib:213: error: ‘__gnu_cxx::strtof’ has not
been declared
  /usr/include/c++/4.1.2/cstdlib:216: error: ‘__gnu_cxx::strtold’ has not
been declared


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11196



More information about the Gcc-bugs mailing list