Re: Fixed some compiler warnings

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Fixed some compiler warnings
Date: 2014-02-03 09:17:52
Message-ID: CA+OCxoz6MiJDCCnB_4gmXuyuL_fVN4w44D3r8kSCw6V_tYaQpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Mon, Feb 3, 2014 at 6:04 AM, Akshay Joshi
<akshay(dot)joshi(at)enterprisedb(dot)com>wrote:

>
>
>
> On Fri, Jan 31, 2014 at 7:26 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>
>>
>>
>>
>> On Fri, Jan 31, 2014 at 6:03 AM, Akshay Joshi <
>> akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
>>
>>>
>>>
>>>
>>> On Thu, Jan 30, 2014 at 7:35 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>>
>>>> Hi
>>>>
>>>>
>>>> On Thu, Jan 30, 2014 at 9:35 AM, Akshay Joshi <
>>>> akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
>>>>
>>>>> Hi Dave
>>>>>
>>>>> I have fixed some compiler warnings which we are facing on OSXMavericks. Attached
>>>>> is the patch file. Can you please review it.
>>>>>
>>>>> If patch looks good to you then can you please commit it.
>>>>>
>>>>>
>>>> It mostly looks good, but what's with the operator changes? Why is it
>>>> complaining about x >= 0 ?
>>>>
>>>
>>> In all such cases x is unsigned int and compiler complaining about
>>> condition "x >=0" will always true.
>>>
>>
>> Ahh yes. However, the proposed fix will always evaluate to true won't it?
>>
>> if (i > 0 || i == 0)
>> {
>>
>> }
>>
>
> Yes it will, but in this case compiler didn't generate any warning.
>

Err, right - but it won't do anything useful (i.e. whatever was intended)
either.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2014-02-03 09:21:54 Re: Fixed some compiler warnings
Previous Message Akshay Joshi 2014-02-03 06:50:16 Re: Fixed some compiler warnings