Fix gdb.arch/i386-sse.exp with clang
authorGary Benson <gbenson@redhat.com>
Mon, 13 Jul 2020 14:14:07 +0000 (15:14 +0100)
committerGary Benson <gbenson@redhat.com>
Mon, 13 Jul 2020 14:14:07 +0000 (15:14 +0100)
gdb.arch/i386-sse.exp fails to run with clang, because of:

 gdb compile failed, /gdbtest/src/gdb/testsuite/gdb.arch/i386-sse.c:56:40: warning:
       passing 'int *' to parameter of type 'unsigned int *' converts between
       pointers to integer types with different sign [-Wpointer-sign]
   if (!x86_cpuid (1, NULL, NULL, NULL, &edx))
                                        ^~~~
 /gdbtest/src/gdb/testsuite/../nat/x86-cpuid.h:35:41: note: passing
       argument to parameter '__edx' here
             unsigned int *__ecx, unsigned int *__edx)
                                               ^
 1 warning generated.

Fix it by declaring edx unsigned.

gdb/testsuite/ChangeLog:

* gdb.arch/i386-sse.c (have_sse) <edx>: Make unsigned.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/i386-sse.c

index fc9dcac563abc3db941cdb5a6c14ec5ea946cb20..8fa0a46c9e004a2451b1ea21a624562d2f021cca 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-13  Gary Benson <gbenson@redhat.com>
+
+       * gdb.arch/i386-sse.c (have_sse) <edx>: Make unsigned.
+
 2020-07-13  Gary Benson <gbenson@redhat.com>
 
        * gdb.base/bigcore.c (main): Use a volatile pointer when
index 72250e024f393f1b7a47ee43724a6ca061b9eb2c..bd9bc1aff37820159d7f1794c374209f4e0f8275 100644 (file)
@@ -51,7 +51,7 @@ v4sf_t data[] =
 int
 have_sse (void)
 {
-  int edx;
+  unsigned int edx;
 
   if (!x86_cpuid (1, NULL, NULL, NULL, &edx))
     return 0;