[PATCH] tests: varlocs workaround format-overflow errors
Mark Wielaard
mark@klomp.org
Wed Dec 8 23:17:16 GMT 2021
On Sat, Dec 04, 2021 at 10:27:29PM +0100, Mark Wielaard wrote:
> 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).
Pushed,
Mark
More information about the Elfutils-devel
mailing list