cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: -Wfloat-equal and -Wunreachable-code used in ares

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 15 Feb 2004 13:33:52 +0100 (CET)

On Fri, 13 Feb 2004, Tor Arntsen wrote:

> When compiling ares with gcc 2.95.2:
> cc1: Invalid option `-Wfloat-equal'
> cc1: Invalid option `-Wunreachable-code'
>
> <http://curl.haxx.se/auto/log.cgi?id=20040213194648-11954>
>
> These warnings seems to be undocumented features of gcc 2.96, and documented
> features of gcc 3.x. As 2.96 was an unofficial snapshot+Redhat hack, those
> warning flags should probably only be added to CFLAGS for gcc3 and onwards,
> if possible.

Thanks for pointing this out. I've fixed it now.

My plan is to use a little shell snippet like the one below to figure what gcc
version that is being used, and then use as pedantic warnings options as
possible for that particular version. Haven't had time to do that yet
though...

 gccver=`$CC --version | head -1 | sed 's/[^0-9.]*//'`
 num1=`echo $gccver | cut -d . -f1`
 num2=`echo $gccver | cut -d . -f2`
 gccnum=`expr $num1 "*" 100 + $num2`
 echo $gccnum

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-02-15