Re: [RFA 12/13] Add ATTRIBUTE_UNUSED to regdat.sh output

Tom Tromey
2018-07-16T16:41:15Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 07/12/2018 09:52 PM, Tom Tromey wrote:
>> This changes regdat.sh to emit ATTRIBUTE_UNUSED for the
>> xmltarget_${name} variable. This seemed simpler than trying to figure
>> out under exactly which circumstances each one was in fact used.

Pedro> Can you give an example configuration where you got a warning?

I only found this one via the buildbot:

https://gdb-build.sergiodj.net/builders/Fedora-s390x-m64/builds/9085

It fails like so:

s390-linux32-generated.c: In function ‘void init_registers_s390_linux32()’:
s390-linux32-generated.c:141:20: error: unused variable ‘xmltarget_s390_linux32’ [-Werror=unused-variable]
static const char *xmltarget_s390_linux32 = "s390-linux32.xml";
^~~~~~~~~~~~~~~~~~~~~~
s390-linux32v1-generated.c: In function ‘void init_registers_s390_linux32v1()’:
s390-linux32v1-generated.c:143:20: error: unused variable ‘xmltarget_s390_linux32v1’ [-Werror=unused-variable]
static const char *xmltarget_s390_linux32v1 = "s390-linux32v1.xml";
^~~~~~~~~~~~~~~~~~~~~~~~
s390-linux32-generated.c: At global scope:
s390-linux32-generated.c:141:20: error: ‘xmltarget_s390_linux32’ defined but not used [-Werror=unused-variable]
s390-linux32v1-generated.c: At global scope:
s390-linux32v1-generated.c:143:20: error: ‘xmltarget_s390_linux32v1’ defined but not used [-Werror=unused-variable]

Tom