Bug 27004

Summary: [GLSL] allowing macro redefinition
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: OtherAssignee: Ian Romanick <idr>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: low CC: brianp
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 29044    

Description Gordon Jin 2010-03-10 17:14:45 UTC
piglit/tests/glslparsertest/shaders/preprocess1.frag gets pass with mesa:

It seems the test case expects to get fail with macro t2 redefinition (and the redefinition is not "effectively the same").

// tests for macro redifinition (t2) and the #if and #else nestings.
// takes care of elif also. 

#define t1 (1+2) 
#define t2 2
#define t2 3 

...
Comment 1 Eric Anholt 2010-08-22 17:43:13 UTC
commit 3882cf21696d2576bd3d855dbc97c9354f72a15f
Author: Carl Worth <cworth@cworth.org>
Date:   Tue Aug 17 23:20:58 2010 -0700

    glcpp: Add support for "redefined macro" error.
    
    Carefully avoiding printing any error when the new definition matches
    the existing definition.
    
    This fixes the recently-added 088-redefine-macro-legitimate.c and
    089-redefine-macro-error.c tests as well as glsparsertest/preprocess1
    in piglit.
Comment 2 Gordon Jin 2010-08-22 18:16:03 UTC
verified

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.