Comment 12 for bug 884185

Revision history for this message
Evan Broder (broder) wrote :

Leo, can you actually switch back to -Wno-warn=unused-result instead of -U_FORTIFY_SOURCE?

_FORTIFY_SOURCE enables a lot more compiler features than just unused result checks, and the package still builds if you just disable the unused result warnings.

Even better would be actually properly checking the results of functions that are throwing the warn_unused_result warnings - there aren't that many of them:

x86_64-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../src -I.. -I../../include -Wall -W -Werror -Wno-error=unused-result -Os -fomit-frame-pointer -std=gnu99 -MT check.o -MD -MP -MF .deps/check.Tpo -c -o check.o ../../src/check.c
../../src/check.c: In function ‘check_md5’:
../../src/check.c:50:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
[...]
x86_64-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../src -I.. -I../../include -Wall -W -Werror -Wno-error=unused-result -Os -fomit-frame-pointer -std=gnu99 -MT execute.o -MD -MP -MF .deps/execute.Tpo -c -o execute.o ../../src/execute.c
../../src/execute.c: In function ‘internal_di_exec’:
../../src/execute.c:88:8: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
../../src/execute.c:93:10: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
../../src/execute.c:101:10: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
../../src/execute.c:157:12: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
../../src/execute.c: In function ‘internal_di_exec_child’:
../../src/execute.c:67:13: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
../../src/execute.c:74:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]