[Mesa-dev] [PATCH] glcpp: initializes version to -1

Juan A. Suarez Romero jasuarez at igalia.com
Mon Nov 7 09:05:35 UTC 2016


On Sat, 2016-11-05 at 10:48 +0100, Karol Herbst wrote:
> 2016-11-05 2:50 GMT+01:00 Ian Romanick <idr at freedesktop.org>:
> > (Sorry about the top post. Sent from my phone.)
> >
> > That expression will allow versions like 0130 as valid.  If you
> just want to
> > allow 0, you need a more complex regular expression.  I feel like
> that's
> > just a bandage... what about other bad values like "#version
> -130"?  Won't
> > that have the same problem that 0 currently has?
> >
> 
> no, it doesn't.
> 
> I tested the patch with glsl_compiler
> 
> "#version 0130": 0:1(10): error: GLSL 0.88 is not supported.
> Supported
> versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
> 
> "#version 0": 0:1(10): error: GLSL 0.00 is not supported. Supported
> versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
> 
> "#version -130":0:1(10): preprocessor error: syntax error, unexpected
> '-', expecting INTEGER or INTEGER_STRING
> 

Correct. It only accepts any positive integer; for negative numbers it
gives an error.

> but
> 
> "#version 0512": 0:1(10): error: GLSL 3.30 is not supported.
> Supported
> versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
> 
> so the issue with this would be, that "0512" is parsed as 3.30, which
> isn't right either, but the current master version does the same. \o/
> new bug found


Good catch! Should this parse mistake filed as a separate bug?

	J.A.



More information about the mesa-dev mailing list