Charles E Campbell wrote:
> Bram Moolenaar wrote:
>> Charles Campbell wrote:
>>
>>> I just noticed that there's a warning when compiling with gcc under
>>> scientific linux:
>>>
>>> misc2.c: In function 'put_time':
>>> misc2.c:6312: warning: ignoring return value of 'fwrite', declared with
>>> attribute warn_unused_result
>>>
>>> In grep'ing through the patches, I see this one must have creeped in
>>> back with patch#649, which in turn was trying to get rid of an annoying
>>> compiler message for whatever compiler Michael Jarvis used.  The
>>> solution was to use (void)fwrite(...) in the put_time() function, but
>>> gcc v4.4.7 gets grumpy even when explicitly told not to worry by the
>>> (void) cast.  IMHO gcc should let explicitly specified ignored values go
>>> unmentioned, but there it is.
>>>
>>> Presumably, given the optimization and fortify settings, the function is
>>> prototyped with __attribute_warn_unused_result__ .
>>>
>>> There are two solutions:
>>>
>>> * apply given patch: this removes the warning using gcc at the price of
>>> a "silly" variable assignment.  I'm afraid that I wouldn't be surprised
>>> if some compiler out there flags silly as an unused variable, though.
>>> * specify either -U_FORTIFY_SOURCE or -D_FORTIFY_SOURCE=0 .  Probably
>>> won't want to do that, I'd guess.
>>>
>>> I didn't see any -W... settings to turn this message off, btw.
>> Let's do it the same way as with put_bytes(): return OK or FAIL
>> depending on what fwrite() returns, which then gets ignored.
>>
> OK -- please try the patch which implements this.
>
Never mind -- I see you've already sent out a patch to do this.

Thank you,
Chip

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui