[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #19416] _FORTIFY_SOURCE warn_unused_result warnings
From: |
Robert Connolly |
Subject: |
[bug #19416] _FORTIFY_SOURCE warn_unused_result warnings |
Date: |
Mon, 26 Mar 2007 01:36:43 +0000 |
User-agent: |
Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko) |
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/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #19416] _FORTIFY_SOURCE warn_unused_result warnings,
Robert Connolly <=