diff options
author | Ian Romanick <[email protected]> | 2014-02-18 09:10:36 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-02-19 15:08:50 -0800 |
commit | 0bd78926304e72ef3566e977d0cb5a959d86b809 (patch) | |
tree | 75daeee0ecf30780f93aeff5513377c1961e9008 /src/glsl/glcpp/tests | |
parent | a4c734297f890eb7034793428ee20c28eaad5a69 (diff) |
glcpp: Only warn for macro names containing __
Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the
GLSL ES spec (all versions) say:
"All macro names containing two consecutive underscores ( __ ) are
reserved for future use as predefined macro names. All macro names
prefixed with "GL_" ("GL" followed by a single underscore) are also
reserved."
The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos. Since every extension adds a name prefixed with GL_ (i.e.,
the name of the extension), that should be an error. Names simply
containing __ are dangerous to use, but should be allowed. In similar
cases, the C++ preprocessor specification says, "no diagnostic is
required."
Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.
Signed-off-by: Ian Romanick <[email protected]>
Cc: "9.2 10.0 10.1" <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Tested-by: Kenneth Graunke <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Tested-by: Darius Spitznagel <[email protected]>
Cc: Tapani Pälli <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
Diffstat (limited to 'src/glsl/glcpp/tests')
-rw-r--r-- | src/glsl/glcpp/tests/086-reserved-macro-names.c.expected | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected index d8aa9f0a648..5ca42a983a4 100644 --- a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected +++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected @@ -1,8 +1,8 @@ -0:1(10): preprocessor error: Macro names containing "__" are reserved. +0:1(10): preprocessor warning: Macro names containing "__" are reserved for use by the implementation. 0:2(9): preprocessor error: Macro names starting with "GL_" are reserved. -0:3(9): preprocessor error: Macro names containing "__" are reserved. +0:3(9): preprocessor warning: Macro names containing "__" are reserved for use by the implementation. |