Bug 10674 - linux-nat.c:2879: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
Summary: linux-nat.c:2879: error: ignoring return value of ‘fgets’, declared with attr...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 6.8
: P2 normal
Target Milestone: 7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-20 23:56 UTC by skierpage
Modified: 2010-02-23 21:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2009-09-20 23:56:12 UTC
On Kubuntu 9.04 amd64 "Jaunty" after executing path/to/gdb/configure then make,
I get:

gcc -c -g -O2   -I. -I/home/skierpage/programs/gdb-6.8/gdb
-I/home/skierpage/programs/gdb-6.8/gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I/home/skierpage/programs/gdb-6.8/gdb/../include/opcode
-I/home/skierpage/programs/gdb-6.8/gdb/../readline/.. -I../bfd
-I/home/skierpage/programs/gdb-6.8/gdb/../bfd
-I/home/skierpage/programs/gdb-6.8/gdb/../include -I../libdecnumber
-I/home/skierpage/programs/gdb-6.8/gdb/../libdecnumber   -DMI_OUT=1 -DTUI=1 
-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror
/home/skierpage/programs/gdb-6.8/gdb/linux-nat.c

cc1: warnings being treated as errors
/home/skierpage/programs/gdb-6.8/gdb/linux-nat.c: In function
‘linux_nat_info_proc_cmd’:
/home/skierpage/programs/gdb-6.8/gdb/linux-nat.c:2879: error: ignoring return
value of ‘fgets’, declared with attribute warn_unused_result
make[2]: *** [linux-nat.o] Error 1
make[2]: Leaving directory `/home/skierpage/programs/gdb-6.8/build/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/home/skierpage/programs/gdb-6.8/build'
make: *** [all] Error 2

The offending line is 
          fgets (buffer, sizeof (buffer), procfile);

(Before you tell me to use the Ubuntu gdb package: the reason I'm building gdb
myself is to try to avoid gdb crashes in iterate_over_threads , possibly because
Ubuntu should have repackaged gdb for kernel and/or libc updates --
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/258578 )
Comment 1 Tom Tromey 2010-02-23 21:02:30 UTC
I believe this was fixed a while ago in cvs.