egcs 19981004 (sparc-sun-solaris2.5): C++ aborts on `#pragma }'
Alexandre Oliva
oliva@dcc.unicamp.br
Tue Oct 6 02:11:00 GMT 1998
Raja R Harinath <harinath@cs.umn.edu> writes:
> After the new #pragma changes, the C++ compiler aborts on seeing
> #pragma }
#pragmas may cause a C++ compiler to behave in an
implementation-defined manner, so the easiest way to fix this bug is
to document it :-)
Since any preprocessor tokens are valid in a pragma directive, this
should be accepted and ignored. However, this is not good practice,
since other compilers might define this pragma as meaning something
obscure.
> This hack is used essentially to confuse the emacs C/C++ editing mode,
> and prevent code from being indented in an
> extern "C" {
> }
How about:
extern "C" {
#if 0
}
#endif
// whatever
#if 0
{
#endif
}
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list