]> git.ipfire.org Git - thirdparty/elfutils.git/commit
tests: varlocs workaround format-overflow errors
authorMark Wielaard <mark@klomp.org>
Sat, 4 Dec 2021 00:18:42 +0000 (01:18 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 8 Dec 2021 23:14:39 +0000 (00:14 +0100)
commitfd2cadbe4749f43551f7df90ee41837d83a6fbc4
tree95ed89e06ddb3fe190aae4ebdb0f744f9f3732c6
parent3e1e249bfd8455457716cce798f3f91d01f2f00d
tests: varlocs workaround format-overflow errors

In function ‘printf’,
    inlined from ‘handle_attr’ at varlocs.c:932:3:
error: ‘%s’ directive argument is null [-Werror=format-overflow=]

The warning is technically correct. A %s argument should not be
NULL. Although in practice all implementations will print it as
"(null)". Workaround this by simply changing the dwarf string
functions to return an "<unknown>" string. The test is for the correct
names, either "(null)" or "<unknown>" would make it fail (also remove
a now unnecessary assert, the switch statement will check for unknown
opcodes anyway).

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/varlocs.c