This is the mail archive of the gcc-patches@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]

Re: Fix include/demangle.h for C++


Andreas Jaeger <aj@suse.de> writes:

| If you compile a file that include demangle.h with g++ like the following:
| #include <demangle.h>
| #include <stdio.h>
| 
| int main(int argc, char ** argv)
| {
|     printf("hello world");
| 
|     return 0;
| }
| 
| You get an error:
| $ g++ -Wall t.cpp -O2
| In file included from t.cpp:1:
| /usr/include/demangle.h:476: error: syntax error before `typename'
| 
| The problem is that typename is a keyword in C++.
| 
| I propose the appended patch.  Ok to commit if it passes
| bootstrap/regtesting on amd64/Linux?

Yes, it qualifies as obvious.

I would really like to see us adopt coding standards about use of C++
keyowrds in C codes in GCC.

-- Gaby


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