curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH 1/2] urlapi: Fix compiler warning on fedora-17.

From: Ben Greear via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 30 Nov 2018 15:08:36 -0800

On 11/30/2018 03:01 PM, Daniel Stenberg wrote:
> On Wed, 28 Nov 2018, Ben Greear via curl-library wrote:
>
>> i = part;
>> - for(o = enc; *i; ++o, ++i)
>> - *o = (*i == ' ') ? '+' : *i;
>> + for(o = enc; *i; ++o, ++i) {
>> + if (*i == ' ')
>> + *o = '+';
>> + else
>> + *o = *i;
>> + }
>
> This is a broken compiler that warns about this. I really prefer the existing one-line version to this 4-line replacement.
>

Well yes, it would be great if the compiler wasn't broken, but still nice to
allow curl to compile (with -Werror) on weird/broken-ish compilers.

I think a few lines of extra code is a small price to pay.

Thanks,
Ben

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-12-01