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

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


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



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