Summary: | gl_marshal.py: generating duplicate declaration specifiers | ||
---|---|---|---|
Product: | Mesa | Reporter: | Tapani Pälli <lemody> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | attempt to fix warnings |
Description
Tapani Pälli
2017-03-16 10:50:31 UTC
Created attachment 130255 [details] [review] attempt to fix warnings this was my 1st attempt to fix this I didn't really looked at the python generator, but this is what came to my mind: maybe one of the consts was meant to be applied to the pointee type? So instead of "const const GLvoid *", it should be "const GLvoid *const"? I agree with Gustaw, that it should be changed to "const GLvoid *const". Something like that should work(not tested): --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -177,11 +177,11 @@ class PrintCode(gl_XML.gl_print_base): with indent(): for p in func.fixed_params: if p.count: - out('const {0} * {1} = cmd->{1};'.format( - p.get_base_type_string(), p.name)) + out('const {0} * const {1} = cmd->{1};'.format( + p.get_base_type_string().lstrip('const'), p.name)) else: out('const {0} {1} = cmd->{1};'.format( - p.type_string(), p.name)) + p.type_string().lstrip('const'), p.name)) if func.variable_params: for p in func.variable_params: out('const {0} * {1};'.format( Gustaw, you're right. Can you prepare a patch that moves the const in the right place? Bartosz, the lstrip() should not be required. Fixed by: commit 31c3c440b5361299fc0529bcf049e9b271d4fab9 Author: Chad Versace <chadversary@chromium.org> Date: Thu Jun 22 15:12:29 2017 -0700 glapi: Fix -Wduplicate-decl-specifier due to double-const Fix all lines in src/mesa/main/marshal_generated.c that declare double-const variables. Below is all such lines, with duplicates removed: $ grep 'const const' marshal_generated.c | sort -u const const GLboolean * pointer = cmd->pointer; const const GLvoid * indices = cmd->indices; const const GLvoid * pointer = cmd->pointer; Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.