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:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  James Youngman <jay>
Originator Name:  Open/Closed:  Closed
Release:  4.2.30 Fixed 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 Files:

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)

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

    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.4