This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/48248] New: Wrong error message location when compiling preprocessed code
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Mar 2011 08:47:38 +0000
- Subject: [Bug preprocessor/48248] New: Wrong error message location when compiling preprocessed code
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48248
Summary: Wrong error message location when compiling
preprocessed code
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: joerg.richter@pdv-fs.de
$ cat > foobar.h << EOF
enum Foo
{
BAR
};
#define BAR(x)
#define BARBAR BAR
EOF
$ cat > main.cc << EOF
#include "foobar.h"
void func()
{
(void)BARBAR;
aaa;
}
EOF
$ g++ -c main.cc
main.cc: In function 'void func()':
main.cc:8:3: error: 'aaa' was not declared in this scope
$ g++ -E main.cc > main.ii
$ g++ -c main.ii
foobar.h: In function 'void func()':
foobar.h:8:3: error: 'aaa' was not declared in this scope
Please notice the wrong filename when compiling the preprocessed source.
GCC 4.4 doesn't have this problem.