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:
Carl Worth
2010-08-23 11:38:45 -07:00
parent 476db2bd3d
commit d3df641f0a
4 changed files with 38 additions and 15 deletions
+4 -4
View File
@@ -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);