mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
glsl/glcpp: Promote "extra token at end of directive" from warning to error
We've always warned about this case, but a recent confromance test expects this to be an error that causes compilation to fail. Make it so. Also add a "make check" test to ensure these errors are generated. This fixes the following Khronos GLES3 conformance tests: invalid_conditionals.tokens_after_ifdef_vertex invalid_conditionals.tokens_after_ifdef_fragment invalid_conditionals.tokens_after_ifndef_vertex invalid_conditionals.tokens_after_ifndef_fragment Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
dac3c986c5
commit
43047384c3
3 changed files with 14 additions and 1 deletions
|
|
@ -625,7 +625,7 @@ replacement_list:
|
||||||
junk:
|
junk:
|
||||||
/* empty */
|
/* empty */
|
||||||
| pp_tokens {
|
| pp_tokens {
|
||||||
glcpp_warning(&@1, parser, "extra tokens at end of directive");
|
glcpp_error(&@1, parser, "extra tokens at end of directive");
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
5
src/glsl/glcpp/tests/126-garbage-after-directive.c
Normal file
5
src/glsl/glcpp/tests/126-garbage-after-directive.c
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#ifdef MACRO garbage
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MORE garbage
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
0:1(15): preprocessor error: extra tokens at end of directive
|
||||||
|
0:4(14): preprocessor error: extra tokens at end of directive
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue