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.
--
Dogs must have a permit signed by the mayor in order to congregate in groups
of three or more on private property.
[real standing law in Oklahoma, United States of America]
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.