curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] curl: Fix compile warning on Fedora-14.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 9 Sep 2017 00:23:38 +0200 (CEST)

On Thu, 7 Sep 2017, greearb_at_candelatech.com wrote:

> mime.c:301:5: error: conversion to 'char' from 'int' may alter its value

...

> - dst[i++] = c? c: '0';
> + if(c)
> + dst[i++] = c;
> + else
> + dst[i++] = '0';

Thanks Ben,

I personally am generally very keen on fixing compiler warnings everywhere as
I truly believe that helps us detect the *real* problems better. But in this
case I'm relucant.

First, this doesn't cause any warnings on the CI build compilers, including
the gcc builds we do (with slightly newer versions than 4.5.1) so this would
only fix warnings caused by an ancient gcc version with a probably buggy
parser, but then also because I think the "fixed" version of the code is more
complicated.

But I'll certainly listen if someone else thinks differently...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-09-09