This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs 19981004 (sparc-sun-solaris2.5): C++ aborts on `#pragma }'
- To: Raja R Harinath <harinath at cs dot umn dot edu>
- Subject: Re: egcs 19981004 (sparc-sun-solaris2.5): C++ aborts on `#pragma }'
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 06 Oct 1998 03:31:45 -300
- Cc: egcs-bugs at cygnus dot com, gtk-devel at redhat dot com
- References: <d9lnmu23ew.fsf@rawana.cs.umn.edu>
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