URL:
<http://savannah.gnu.org/bugs/?19416>
Summary: _FORTIFY_SOURCE warn_unused_result warnings
Project: findutils
Submitted by: ashes
Submitted on: Monday 03/26/2007 at 01:36
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.30
Fixed Release: None
_______________________________________________________
Details:
Hello. When _FORTIFY_SOURCE=2 is defined we get a few warnings about unused
return values:
pred.c:625: warning: ignoring return value of 'fwrite', declared with
attribute warn_unused_result
pred.c:629: ... ditto ...
frcode.c:221: ... ditto ...
code.c:188: ... 'fgets' ...
code.c:189: ... 'fwrite' ...
Is there something we can do about this to make -Werror happy? Something in
the neighbourhood of:
- fwrite (segment->text, 1, segment->text_len, fp);
+ size_t written = 0;
+ written += fwrite (segment->text, 1, segment->text_len, fp);
+ if ( written < 0 )
+ {
+ exit(EXIT_FAILURE);
+ }
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?19416>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils