On Tue, Mar 27, 2007 at 09:47:35AM -0700, Joe Buck wrote:
> On Tue, Mar 27, 2007 at 02:11:21PM +0100, Manuel López-Ibáñez wrote:
> > On 27/03/07, Martin Michlmayr <[EMAIL PROTECTED]> wrote:
> > >* Manuel López-Ibáñez <[EMAIL PROTECTED]> [2007-03-27 14:01]:
> > >> >Thanks for the explanation - this explains what I'm seeing.  Is there
> > >> >a good reason against changing this particular warning from
> > >> >CPP_DL_PEDWARN to CPP_DL_WARNING?  Quite a few packages in Debian fail
> > >> >to build because of this and it seems overly strict to me.  However, if
> > >> >it'll remain an error with C++ code, I'll start filing bugs on these
> > >> >packages.
> > >>
> > >> I cannot answer why this is a pedwarn or why C++ emits pedantic errors
> > >> by default.
> > >
> > >Sorry for not being clearer; this question wasn't specifically
> > >directed at you.  Hopefully someone else, maybe Joseph, can answer it.
> > 
> > Nevertheless, if this is indeed a diagnostic required by the standard,
> > perhaps we should just conditionalize it on the presence of -pedantic
> > in the command-line (rather than being unconditional as it is now).
> 
> It is not required by the standard to diagnose all undefined behavior.
> I've used operating systems in the ancient past (e.g. VMS) where it might
> not even be possible to issue the diagnostic, because there are file types
> for which the preprocessor would not even "see" the partial line.

Yes.  In the original C89 standard discussions, one of the problems was how to
describe the input in the face of record oriented systems, including systems
that had virtual card readers, etc.  The problem comes out of the phases of
translation (5.1.1.2 in the C99 standard, should be close in the C90
standard).  In particular, in paragraph 3, it says:

            A source file shall not end in a partial preprocessing token or a
            partial comment...

If there is no trailing (logical) newline, then the file would end in a partial
preprocessing token.

> (I knew the acronym "RMS" as "Record Management Services" before I ever
> heard of a certain person who started a certain compiler).
> 
> 

-- 
Michael Meissner, AMD
90 Central Street, MS 83-29, Boxborough, MA, 01719, USA
[EMAIL PROTECTED]


Reply via email to