This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11196] parse error before numeric constant


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]