This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]