Menu

#1 warn_unused_result warnings

open
nobody
None
5
2009-06-24
2009-06-24
Anonymous
No

To avoid warn_unused_result warnings you'd better use an 'int rc = ' construct
to store the return value of write(), chroot(), chdir() and nice().

gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

---------
gcc -O2 -Wall -W -pipe -D_GNU_SOURCE -c -o mingetty.o mingetty.c
mingetty.c: In function âopen_ttyâ:
mingetty.c:195: warning: ignoring return value of âwriteâ, declared with attribute warn_unused_result
mingetty.c: In function âmainâ:
mingetty.c:426: warning: ignoring return value of âchrootâ, declared with attribute warn_unused_result
mingetty.c:428: warning: ignoring return value of âchdirâ, declared with attribute warn_unused_result
mingetty.c:430: warning: ignoring return value of âniceâ, declared with attribute warn_unused_result
gcc mingetty.o -o mingetty
---------

Peter
peter.thoemmes@gmx.de

Discussion


Log in to post a comment.