This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Testing build failure with latest GCC
- From: Steve Ellcey <sellcey at cavium dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 25 May 2017 09:50:53 -0700
- Subject: Testing build failure with latest GCC
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=cavium.com;
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
I am building the top-of-tree glibc with top-of-tree gcc and getting
these messages when running 'make check'. Should we explicitly ignore
the return value of fgets in these tests or check it and set 'failed'
if it is not the expected value? Or do we think GCC is at fault? It
seems like a legimate warning and we do compile with -Wall -Werror.
Steve Ellcey
sellcey@cavium.com
test-assert.c: In function ‘main’:
test-assert.c:75:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
^
test-assert.c:79:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
^
test-assert.c:83:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
test-assert-perr.c: In function ‘main’:
test-assert-perr.c:73:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
^
test-assert-perr.c:77:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
^
test-assert-perr.c:81:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets (buf, 160, stderr);
^
cc1: all warnings being treated as errors