[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] Fix some main() return types

From: Marko Lindqvist
Subject: Re: [Patch] Fix some main() return types
Date: Thu, 19 Jun 2008 23:05:04 +0300

2008/6/17 Eric Blake:
> Marko Lindqvist <cazfi74 <at>> writes:
>>  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?

 I wrote the original patch a couple of months ago and can't really
remember exact error message.
 Now I fail to reproduce it with any build setup I have :-(
 Compiler was certainly gcc (maybe cross-compiler) I'll produce some
tool-chains with older versions and see if I can reproduce the warning
message then.

>  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?

 That was actually first version I used, but having such limited
knowledge about autoconf I decided to change it to produce return
value 'the right way' just in case.

 - ML

reply via email to

[Prev in Thread] Current Thread [Next in Thread]