egcs 19981004 (sparc-sun-solaris2.5): C++ aborts on `#pragma }'

Alexandre Oliva
Tue Oct 6 02:11:00 GMT 1998

Raja R Harinath <> 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

> 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
// whatever
#if 0

Alexandre Oliva
Universidade Estadual de Campinas, SP, Brasil

More information about the Gcc-bugs mailing list