emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

attribute warn_unused_result


From: Eli Zaretskii
Subject: attribute warn_unused_result
Date: Thu, 03 Feb 2011 09:57:55 -0500

fencepost.gnu.org was upgraded to GCC 4.4.3-4ubuntu5 and glibc 2.11,
and that combination causes GCC to emit several warnings like these
while compiling Emacs:

  sysdep.c: In function 'sys_subshell':
  sysdep.c:550: warning: ignoring return value of 'chdir', declared with 
attribute warn_unused_result
  sysdep.c:581: warning: ignoring return value of 'write', declared with 
attribute warn_unused_result
  fileio.c: In function 'Fcopy_file':
  fileio.c:1968: warning: ignoring return value of 'fchown', declared with 
attribute warn_unused_result

Do we care about these warnings?  There's significant controversy
about them (e.g., the warnings about `write' are when we write an
error message to stderr, in which case there's nothing useful one can
do with the return value), so I'm not sure we should care.

If we do care about this, we should fix the code; if not, we should
either add "-Wno-unused-result" to the compilation switches, or use
`#pragma GCC diagnostic ignored "-Wunused-result"' in the affected
source files.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]