[Mesa-dev] [PATCH 1/2] glcpp: Allow for conditional conversion of an undefined macro to zero.

Carl Worth cworth at cworth.org
Sat Nov 24 09:39:34 PST 2012


Carl Worth <cworth at cworth.org> writes:
> With this change, there's no (intended) behavioral change. The
> undefined_macro_mode flag is set to UNDEFINED_MACRO_IS_ZERO only when
> expanding an #if or #elif expression. All other expansions will leave the
> undefined macro as an identifier.

I'm going to NAK this patch myself. I think it's excessively
over-complicated.

I believe what we can do instead is to just change the following code:

>  expression:
>  	integer_constant
> -|	IDENTIFIER {
> -		$$ = 0;
> -	}

to have a conditional call to glcpp_error in the case where an undefined
identifier should not have a value of zero. That's the approach Ian
suggested anyway.

I'll test that Monday morning.

-Carl

PS. I still do need a bit of guidance on what the right condition is for
this, (as mentioned in the other patch I sent previously).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121124/c560ec4b/attachment.pgp>


More information about the mesa-dev mailing list