[Mesa-stable] [Mesa-dev] [PATCH 04/15] glsl: Add preprocessor error condition for #else directive

Carl Worth cworth at cworth.org
Wed Jun 11 18:51:33 PDT 2014


Anuj Phogat <anuj.phogat at gmail.com> writes:
>> #if 0
>> #else garbage
>> #endif
>>
>> The Khronos test contains two tokens after #else. I'm not sure if that
>> is the difference or not.
> Khronos is testing many different cases. Failing case tests:
>
> #if 1
> #else garbage
> #endif

It is the "#if 1" that causes the existing code to catch the garbage
after #else. So yes, the existing test case does need to be expanded.

In the meantime, the proposed fix (to the lexer) is not correct as it
will cause an error in the following case which should be accepted:

#if 1
#else /* comments are whitespace, not garbage */
#endif

I'll poke around at the existing code to see why the garbage after #else
is caught with #if 0, but not with #if 1.

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20140611/d1b5f4c9/attachment.sig>


More information about the mesa-stable mailing list