Bug 5315 - 6.41 Win32 Build is broken w/ VC++ 6.0 SP6 s_triangle.c (C99 syntax abuse)
Summary: 6.41 Win32 Build is broken w/ VC++ 6.0 SP6 s_triangle.c (C99 syntax abuse)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 6.4
Hardware: x86 (IA32) Windows (All)
: high major
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-11 09:16 UTC by Kyle Hamilton
Modified: 2007-01-23 17:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Kyle Hamilton 2005-12-11 09:16:02 UTC
The build of Mesa on VC++ 6.0 SP6 is broken in src\mesa\swrast\s_triangle.c.

I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2275: 'GLuint' :
illegal use of this type as an expression
  ../../../../include\GL/gl.h(155) : see declaration of 'GLuint'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2146: syntax error
: missing ';' before identifier 'i'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2065: 'i' :
undeclared identifier
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2275: 'GLuint' :
illegal use of this type as an expression
  ../../../../include\GL/gl.h(155) : see declaration of 'GLuint'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2146: syntax error
: missing ';' before identifier 'i'


I have traced these all to the abuse of C99 syntax, specifically in the
RENDER_SPAN() macro that is defined before one of the inclusions of s_tritemp.h.  

To fix: In any macro that defines a local variable (such as GLuint i;), always
surround the macro expansion with braces to create a sub-block.  (This is at
s_triangle.c, with locations at lines 165, 216, and 916.)
Comment 1 Brian Paul 2005-12-13 02:22:23 UTC
Already fixed in CVS.


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.