This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11196] parse error before numeric constant
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jun 2003 17:29:14 -0000
- Subject: [Bug c++/11196] parse error before numeric constant
- References: <20030615172415.11196.is88071@cis.nctu.edu.tw>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11196
------- Additional Comments From gdr@integrable-solutions.net 2003-06-15 17:29 -------
Subject: Re: New: parse error before numeric constant
"is88071@cis.nctu.edu.tw" <gcc-bugzilla@gcc.gnu.org> writes:
| I wrote a simple C++ programing using GCC 3.2-cygwin, MingW, Linux, etc version
| as below.
| ===================
| #include<iostream>
| using namespace std;
|
| const double M_PI = 3.1415;
|
| int main()
| {
| cout << M_PI << endl;
| return 0;
| }
| ===================
|
| There're a parsing error in "M_PI". It has been defined in cmath(math.h) as:
| #define M_PI 3.14159265358979323846
|
| But, I didn't include the <cmath> header file.
Agreed. However, <iostream> is permitted to include <cmath>. But
<cmath> is not supposed to define M_PI, that we fail to provide a
clean <cmath> is a bug in libstdc++. However what the right fix
should be is not obvious.
-- Gaby