🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #206

Re: ANSI C spec and GNU C preprocessing

#206
From: Gordon Burditt
Date: Sun, 12 Apr 1992 03:12
38 lines
2139 bytes
>1) When a conforming preprocessor encounters a '#' directive which
>   is not listed in the preprocessor syntax (ex. '#foo'), what is
>   the correct behavior -- declare a fatal error, display a warning,
>   or pass it unchanged silently to the compiler?

There is no such thing as a 'conforming preprocessor'.  There is no 
ANSI-defined difference between different pieces of a compiler.
The output consists of warning/error messages and/or object code.
There is no ANSI-defined way to tell if a fatal error message came from
a "preprocessor" or a "compiler", whatever they are.  *SOMETHING*
needs to emit a diagnostic.  ANSI requires certain diagnostics and
permits others.  It is not at all clear that all ANSI-required diagnostics
should be fatal errors (The standard does not require it), so the
fatal/nonfatal line and the required/optional diagnostic line will
be drawn differently.

>2) A conforming preprocessor must output line directives (3.8.4)
>   in the format:

There is no such thing as 'a conforming preprocessor'.  Nothing
outputs line directives; a conforming implementation must accept them
as input.  There is no guaranteed way to even obtain something called
'preprocessor output', whatever that is.  Most implementations allow it, 
but there is no ANSI guarantee that you can obtain it, or that it
won't look like encrypted tokenized TRS-80 Model I BASIC.


>   'line'.  For example:
>
>	# 34 "myheader.h"

This form need not be accepted as input.  ANSI does not recognize the
existence of a 'preprocessor', nor 'preprocessor output', nor any
specified form of translating #line directives in one pass for use
by later passes.

					Gordon L. Burditt
					sneaky.lonestar.org!gordon
Technical Details
Message-ID: <1992Apr12.101628.23673@sneaky.lonestar.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!seas.smu.edu!utacfd.uta.edu!trsvax!rwsys!sneaky!gordon
References: <1992Apr9.213900.26576@urbana.mcd.mot.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!seas.smu.edu!utacfd.uta.edu!trsvax!rwsys!sneaky!gordon
From: gordon@sneaky.lonestar.org (Gordon Burditt)
Subject: Re: ANSI C spec and GNU C preprocessing
Message-ID: <1992Apr12.101628.23673@sneaky.lonestar.org>
Organization: Gordon Burditt
References: <1992Apr9.213900.26576@urbana.mcd.mot.com>
Date: Sun, 12 Apr 1992 03:12:37 GMT
Lines: 38