glcpp: Demote "macro redefined" from an error to a warning
The GLSL specification is vague here, (just says "as is standard for C++"), though the C specifications seem quite clear that this should be an error. However, an existing piglit test (CorrectPreprocess11.frag) expects this to be a warning, not an error, so we change this, and document in README the deviation from the specification.
This commit is contained in:
@@ -1687,8 +1687,8 @@ _define_object_macro (glcpp_parser_t *parser,
|
||||
talloc_free (macro);
|
||||
return;
|
||||
}
|
||||
glcpp_error (loc, parser, "Redefinition of macro %s\n",
|
||||
identifier);
|
||||
glcpp_warning (loc, parser, "Redefinition of macro %s\n",
|
||||
identifier);
|
||||
}
|
||||
|
||||
hash_table_insert (parser->defines, macro, identifier);
|
||||
@@ -1718,8 +1718,8 @@ _define_function_macro (glcpp_parser_t *parser,
|
||||
talloc_free (macro);
|
||||
return;
|
||||
}
|
||||
glcpp_error (loc, parser, "Redefinition of macro %s\n",
|
||||
identifier);
|
||||
glcpp_warning (loc, parser, "Redefinition of macro %s\n",
|
||||
identifier);
|
||||
}
|
||||
|
||||
hash_table_insert (parser->defines, macro, identifier);
|
||||
|
||||
Reference in New Issue
Block a user