#pragma does only half the job (was Re: Pragma and noalias)

T. William Wells bill at proxftl.UUCP
Fri Jul 22 22:11:30 AEST 1988


In article <4580 at pasteur.Berkeley.Edu> faustus at ic.Berkeley.EDU (Wayne A. Christopher) writes:
> In article <502 at proxftl.UUCP>, bill at proxftl.UUCP (T. William Wells) writes:
> > "[a pragma] causes the implementation to behave in an
> > implementation-defined manner...."
> >
> > My reading of this says that a pragma changes the implementation,
> > not (directly) the interpretation of the program.  However, the
> > changed implementation must also be conforming.
>
> You're right, this statement is sort of confusing, but when you think
> about it, it has to mean that #pragma can cause a compiler to become
> non-conforming.  Otherwise, #pragma noalias wouldn't be possible.
> Telling the compiler that a set of parameters is noalias changes the
> semantics of the function.

Perhaps you came in late on this debate?  The whole point of it
is whether the standard DOES allow the use of #pragma to specify
noalias (and friends).  The reading I give to it prohibits this;
other readings permit it.

Reading 1: #pragma modifies the implementation.  #pragma noalias
    is not permitted.

Reading 2: #pragma modifies the program.  Anything goes,
    including #pragma noalias.

And, as I said, this ought to be clarified for the next draft
standard.



More information about the Comp.lang.c mailing list