On Fri, 30 Sep 2011 12:32:13 -0700, Ian Romanick <i...@freedesktop.org> wrote:
> > In any case, the test quotes specific language from the GLSL spec that
> > explicitly forbids this behavior, so I'm somewhat reluctant to deviate
> > from the spec'ed behavior.

We're not deviating from what is specified.

We do raise an error when an undefined macro is used within an #if or
#elif (other than as an argument to "defined").

The only difference between our implementation and the original test is
that is that the test expected us to flag this error when the condition
was irrelevant, such as this:

#if 0
...
#elif UNDEFINED_MACRO
...
#endif

And that is not actually explicitly called out by the spec.

> Though, it turns out that this deviates from what C99 specifies. 
> Specifically, the ISO/IEC 9899:TC2 Committee Draft dated May 6, 2005 says:
> 
>      "After all replacements due to macro expansion and the defined unary
>      operator have been performed, all remaining identifiers are replaced
>      with the pp-number 0..."

Yes, I noticed this was different when I did the original
implementation. It wasn't hard to do what the GLSL specification says.

> I've submitted a GLSL spec bug.

OK. If GLSL should align better with C99 then that's a good plan.

-Carl

Attachment: pgpMt0VJkoTqe.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to