about summary refs log tree commit diff
path: root/shlib-versions
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-06-20 22:18:22 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-06-20 22:18:22 +0000
commit1760daadda047a5fac43c7902ca2cd924612dea7 (patch)
tree1a21c0dc151627dbdeb0b5684fa9b297ca60adcb /shlib-versions
parent209ae17c60a905f2b6e951d6609a898f4b9891f6 (diff)
downloadglibc-1760daadda047a5fac43c7902ca2cd924612dea7.tar.gz
glibc-1760daadda047a5fac43c7902ca2cd924612dea7.tar.xz
glibc-1760daadda047a5fac43c7902ca2cd924612dea7.zip
Fix bug-strspn1.c, bug-strpbrk1.c build with GCC mainline.
Building the testsuite with GCC mainline fails with:

bug-strspn1.c: In function 'main':
bug-strspn1.c:14:3: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
   strspn (b++, "");
   ^~~~~~~~~~~~~~~~

and a similar error for bug-strpbrk1.c.  I'm not sure what GCC change
introduced this, and the wording of the message is a bit off (in the
source it's not a comma expression, that must reflect GCC's IR).  But
the warning is correct (strspn is a pure function, the call is
useless, and if there wasn't an argument with a side effect much older
GCC would have warned); the point of the test is to verify that the
side effect in an argument still occurs for this useless call that can
otherwise be optimized to an (unused) constant (testing for a bug
there once was in an old strspn macro).  This patch duly arranges for
the warning to be disabled for this code.

Tested with build-many-glibcs.py for aarch64-linux-gnu.

	* string/bug-strpbrk1.c: Include <libc-diag.h>.
	(main): Disable -Wunused-value around call to strpbrk.
	* string/bug-strspn1.c: Include <libc-diag.h>.
	(main): Disable -Wunused-value around call to strspn.
Diffstat (limited to 'shlib-versions')
0 files changed, 0 insertions, 0 deletions