Re: [cc65] preprocessor hazzle...

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-07-27 09:16:03


Hi!

On Fri, Jul 26, 2002 at 10:15:20PM +0200, Christian Groessler wrote:
> Wasn't the behaviour of #pragma implementation defined? (at least in
> c89?).
> I remember a code snippet from a 1.x gcc version, which when
> encountering a pragma directive started a game from /usr/games?
> "This implementation defines #pragma this way" :-)

They are still implementation defined. However, I'm not sure if
"implementation defined" includes printing error messages, since the standard
explicitly states that unknown pragmas may not generate errors.

There has been a long discussion about the usefulness of #pragmas. gcc refused
for a long time to implement any pragmas (apart from the "unusual" ones you've
mentioned). One of the problems is that two compilers may implement pragmas
with the same name differently, so to be safe, one *always* has to put a
#pragma into a #if that checks for a specific compiler.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-07-27 09:16:34 CEST