[patch c++]: Fix warnings in decl2.c

Manuel López-Ibáñez lopezibanez@gmail.com
Thu Jul 1 07:01:00 GMT 2010


On 1 July 2010 06:30, Jason Merrill <jason@redhat.com> wrote:
> On 06/30/2010 05:31 PM, Manuel López-Ibáńez wrote:
>>
>> On 30 June 2010 23:28, Jason Merrill<jason@redhat.com>  wrote:
>>>
>>> On 06/09/2010 10:53 AM, Kai Tietz wrote:
>>>>
>>>> 2010-06-09  Kai Tietz
>>>>
>>>>        * decl2.c (min_vis_r):
>>>>        (constrain_visibility):
>>>
>>> Odd ChangeLog entry :)
>>>
>>> I would rather fix these warnings by changing the type of the variable
>>> itself, but that looks to be complicated in this case, so I guess this
>>> patch
>>> is OK.
>>
>> Are these valid warnings at all? The fact that we don't warn for this
>> in recent GCC either suggests that they are not or that we have
>> regressed in terms of diagnostics.
>
> Well, since there are no negative values in enum symbol_visibility, I
> believe that GCC makes it compatible with unsigned int, so comparing such a
> value to int is indeed a comparison between signed and unsigned.  But since
> DECL_VISIBILITY is a bit-field, the possible range of values is less than
> the range of the type, so the comparison is safe and the warning is a false
> positive.

So if trunk regresses in this diagnostic aspect, we won't detect it
because we are adding workarounds for old broken compilers that are
not needed in trunk. Great.

Manuel.



More information about the Gcc-patches mailing list