[ovs-dev] [PATCH] util: fix compile warnings

Ansis Atteka aatteka at nicira.com
Mon Jul 7 16:40:52 UTC 2014


Yes, Yamamoto-san's patch fixed warning by using CONST_CAST. I think
changing "program_name" type to "char*" could be a cleaner solution.

However, it does not address the second issue for branch-2.3 (ISO C90
forbids mixed declarations and code). This same issue is not present
in master though.

On Mon, Jul 7, 2014 at 8:09 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Fri, Jul 04, 2014 at 12:33:03PM -0700, Ansis Atteka wrote:
>> This patch fixes two compile warnings introduced by commit
>> 64b73291 ("util: create a copy of program_name"):
>> 1. ../lib/util.c:457:5: error: passing argument 1 of 'free'
>>    discards 'const' qualifier from pointer target type; And
>> 2. ../lib/util.c:463:5: error: ISO C90 forbids mixed declarations
>>    and code [-Werror=declaration-after-statement] (affected only
>>    branch-2.3 that is C90 compliant and not the master)
>>
>> Reported-By: Joe Stringer <jstringer at nicira.com>
>> Reported-By: Lorand Jakab <lojakab at cisco.com>
>> Signed-Off-By: Ansis Atteka <aatteka at nicira.com>
>
> I don't see any warnings on current master.  Did Yamamoto-san's commit
> (util: Suppress a warning by adding CONST_CAST) fix them?



More information about the dev mailing list