[Mesa-dev] [PATCH] glsl: remove trailing comma in enum lists to silence warning

Jose Fonseca jfonseca at vmware.com
Mon May 9 21:35:08 UTC 2016


On 09/05/16 12:29, Eric Anholt wrote:
> Ian Romanick <idr at freedesktop.org> writes:
>
>> On 05/03/2016 10:17 PM, Eric Anholt wrote:
>>> Brian Paul <brianp at vmware.com> writes:
>>>
>>>> On 05/02/2016 06:15 PM, Ilia Mirkin wrote:
>>>>> I know I've been sticking commas at the end of enums left and right
>>>>> for the past several years, and haven't heard any complaints. The nice
>>>>> thing about the trailing comma is that you avoid having to change
>>>>> unrelated lines when adding entries. This leads to cleaner per-line
>>>>> histories, which can be useful to see when something was added.
>>>>
>>>> Yeah, I'd like to use trailing commas too, but I'd rather not see
>>>> warnings.  I'm not sure why/when this started.
>>>
>>> I think we should just refuse to build with -Wpedantic, instead.
>>
>> I believe Jose recently added -Wpedantic to catch some things that GCC
>> normally allows that MSVC does not.  Something about mixing C99 with
>> C++?  I don't recall the details.

Right.

The commit in question is 
https://cgit.freedesktop.org/mesa/mesa/commit/?id=99474dc29b0f45413d0e538d7321da9ad4c9f6f5

> So pick the warning you want, don't just enable the collection of
> garbage warnings that is known as -Wpedantic.

If that was possible I'd have done that from the start and we wouldn't 
be having this conversation...

Unfortunately, the warning I'm interested has no warning option, which 
is why I tried to enable -Wpedantic on the smallest sub-section of code.


Anyway, I'm perfectly fine reverting 
99474dc29b0f45413d0e538d7321da9ad4c9f6f5 .

It was an experiment.  I don't like -Wpedantic either, and I knew from 
the start this was a likely outcome.   Maybe GCC will get a finer 
grained option to warn about using non-standard C99 options with C++ in 
the futere.  (Clang has -Wc99-extensions , but even that's a bit more 
verbose than I'd want.)


Jose


More information about the mesa-dev mailing list