Hello:
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.
Regards,
Chip Campbell
--
--
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.
*** orig_misc2.c 2016-01-07 15:51:58.078268636 -0500
--- misc2.c 2016-01-07 15:50:57.389232548 -0500
***************
*** 6307,6315 ****
time_t the_time;
{
char_u buf[8];
time_to_bytes(the_time, buf);
! (void)fwrite(buf, (size_t)8, (size_t)1, fd);
}
/*
--- 6307,6316 ----
time_t the_time;
{
char_u buf[8];
+ size_t silly;
time_to_bytes(the_time, buf);
! silly=fwrite(buf, (size_t)8, (size_t)1, fd);
}
/*