[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Fix some main() return types
From: |
Eric Blake |
Subject: |
Re: [Patch] Fix some main() return types |
Date: |
Tue, 17 Jun 2008 19:37:49 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Marko Lindqvist <cazfi74 <at> gmail.com> writes:
>
> What is your policy about compiler warnings from successfully
> completing autoconf tests? Attached patch fixes one such warning,
> caused by having main() returning char instead of int.
We don't mind squashing easy warnings, as long as the resulting code is still
maintainable. But we also tend to prefer targetting only gcc warnings; there
are far too many compilers, and far too many warnings, to squash everything for
all compilers.
>
> A couple of c.m4 macros declare function with return type char, and
> then return same return value from main(). Attached patch translates
> character from function into int 0 or 1 to be returned from main().
Which compiler, and what warning does it output? Since this appears to be only
link tests (ie. we don't care about the actual return value, only that the
compiler doesn't optimize out the function call), would the simpler:
return !func();
also squash the warning?
--
Eric Blake