cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] configure: adjust tests to avoid -Werror breakage

From: Peter Wu <peter_at_lekensteyn.nl>
Date: Wed, 05 Nov 2014 19:16:49 +0100

On Tuesday 04 November 2014 08:40:16 Daniel Stenberg wrote:
> On Tue, 4 Nov 2014, Peter Wu wrote:
>
> > These series allow ./configure to run when CFLAGS contains -Werror.
>
> While I generally strongly agree with having C code comply with -Werror and
> other strict rules, this is a pretty invasive change in territory that is by
> definition very conservative and fragile. The configure script serves its
> purpose the best on the platforms we rarely use and none of us regular
> contributors ever use. We move slow and with caution here.

The changes with this patch are trivial, mostly adding void casts here and
there. If a platform breaks on (void)x;, then it is pretty broken.

> This said, other than pedentic reasons, why do you want -Werror in CFLAGS for
> configure? We've offered --enable-werror since forever and it is generally
> even better since it actually also checks the compiler and it only affects the
> generated output and not every single test configure itself does.

Ah, I will use --enable-werror to enable -Werror then. I am used to enabling
-Werror in this way. From a quick look, the tests are not built with -Werror
though. Is that correct?

> > This patch was created because configure was bailing out due to a linking
> > error. (due to a missing 'int' return value for main IIRC).
>
> C has a default type of int and that test has worked on a fairly large amount
> of compilers and systems already... I assume you meant that it too failed with
> -Werror in CFLAGS?

Yes, it failed due to -Werror. A sane compiler should not break on this change.

-- 
Kind regards,
Peter
https://lekensteyn.nl
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-05