bugfindutils - Bugs: bug #19416, _FORTIFY_SOURCE warn_unused_result...

 
 

bug #19416: _FORTIFY_SOURCE warn_unused_result warnings

Submitter:  Robert Connolly <ashes>
Submitted:  Mon 26 Mar 2007 01:36:42 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.2.30 Fixed Release:  4.3.7
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 06 May 2007 08:14:58 PM UTC, comment #2: 

The only _FORTIFY_SOURCE warnings now left in the CVS code for findutils 4.3.x are two instances of "control reaches end of non-void function".  Eyeballing the definitions, I can't see how that would actually happen.   So I'm marking this bug fixed.

James Youngman <jay>
Group administrator
Sat 05 May 2007 12:55:01 PM UTC, comment #1: 

Some of these are fixed, and recorded in separate bugs; for example, the fixes to code and frcode.

James Youngman <jay>
Group administrator
Mon 26 Mar 2007 01:36:42 AM UTC, original submission:  

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);
+  }

Robert Connolly <ashes>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by ashes (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-06-09 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3.7
    2007-05-06 jay StatusNone Fixed
        Assigned toNone jay

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code