You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2016/05/20 07:29:04 UTC

[Bug 7324] New: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

            Bug ID: 7324
           Summary: ignoring return value of ‘write’, declared with
                    attribute warn_unused_result [-Wunused-result]
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: spamc/spamd
          Assignee: dev@spamassassin.apache.org
          Reporter: jidanni@jidanni.org

gcc  -g -O2 spamc/spamc.c spamc/getopt.c spamc/libspamc.c spamc/utils.c \
        -o spamc/spamc   -ldl -lz 
spamc/libspamc.c: In function ‘libspamc_log’:
spamc/libspamc.c:2242:9: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result [-Wunused-result]

http://stackoverflow.com/questions/9148134/declared-with-attribute-warn-unused-result-wunused-result
says this is asking for trouble.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7324] ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

jidanni@jidanni.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jidanni@jidanni.org

--- Comment #2 from jidanni@jidanni.org ---
You know these warnings interrupt a smooth compilation.

Emacs prompts me for where the problem is.

Yes they might not appear in the developers compiler, but can't you people
please tidy up your code so it doesn't make warnings.

gcc  -g -O2 spamc/spamc.c spamc/getopt.c spamc/libspamc.c spamc/utils.c \
                -o spamc/spamc   -ldl -lz 
spamc/libspamc.c: In function ‘libspamc_log’:
spamc/libspamc.c:2238:9: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result [-Wunused-result]

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7324] ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

Kevin A. McGrail <km...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
   Target Milestone|3.4.2                       |3.4.3
             Status|NEW                         |RESOLVED

--- Comment #5 from Kevin A. McGrail <km...@apache.org> ---
Without a patch, I'm considering Mark's comment as good enough.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7324] ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

--- Comment #4 from jidanni@jidanni.org ---
I found
https://stackoverflow.com/questions/7271939/warning-ignoring-return-value-of-scanf-declared-with-attribute-warn-unused-r

It is up to the authors to decide what path to take.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7324] ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

Kevin A. McGrail <km...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@apache.org

--- Comment #3 from Kevin A. McGrail <km...@apache.org> ---
Patches welcome as otherwise it's a warning that Mark already addressed the
meat of the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7324] ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7324

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.4.2

--- Comment #1 from Mark Martinec <Ma...@ijs.si> ---
> stackoverflow ... says this is asking for trouble.

Yes, ignoring status return is asking for trouble.
When return code is intentionally ignored, at least it should be
clearly documented why this is so.

In this particular case (in libspamc_log) it is not so terrible,
as all we can lose is a log output (and if stderr is not writable
there is probably no place to send an error message to).

It is more troublesome that calls to SSL_write in that same module
are not checked for status. I think there is already a bug open somewhere,
claiming that mail can be lost/truncated when spamc uses SSL.

Should be fixed - patches welcome...

-- 
You are receiving this mail because:
You are the assignee for the bug.