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


bug #19416: _FORTIFY_SOURCE warn_unused_result warnings

Submitted by:  Robert Connolly <ashes>
Submitted on:  Mon 26 Mar 2007 01:36:42 AM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.2.30Fixed Release: 4.3.7

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 )
+ {
+ }

Robert Connolly <ashes>


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 09 Jun 2007 06:32:51 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.7
    Sun 06 May 2007 08:14:58 PM UTCjayStatusNone=>Fixed
      Assigned toNone=>jay

    Back to the top

    Powered by Savane 3.1-cleanup1