[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/9] pc-bios/s390-ccw: Silence warning from Clang by marking panic
From: |
Thomas Huth |
Subject: |
[PULL 5/9] pc-bios/s390-ccw: Silence warning from Clang by marking panic() as noreturn |
Date: |
Mon, 10 May 2021 09:35:20 +0200 |
When compiling the s390-ccw bios with Clang, the compiler emits a warning:
pc-bios/s390-ccw/main.c:210:5: warning: variable 'found' is used uninitialized
whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
pc-bios/s390-ccw/main.c:214:16: note: uninitialized use occurs here
IPL_assert(found, "Boot device not found\n");
^~~~~
It's a false positive, it only happens because Clang is not smart enough
to see that the panic() function in the "default:" case can never return.
Anyway, let's explicitely mark panic() with "noreturn" to shut up the
warning.
Message-Id: <20210502174836.838816-2-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/s390-ccw.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 6cd92669e9..79db69ff54 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -89,6 +89,7 @@ bool menu_is_enabled_enum(void);
#define MAX_BOOT_ENTRIES 31
+__attribute__ ((__noreturn__))
static inline void panic(const char *string)
{
sclp_print(string);
--
2.27.0
- [PULL 0/9] s390-ccw bios update, Thomas Huth, 2021/05/10
- [PULL 1/9] pc-bios/s390-ccw: don't try to read the next block if end of chunk is reached, Thomas Huth, 2021/05/10
- [PULL 2/9] pc-bios/s390-ccw/bootmap: Silence compiler warning from Clang, Thomas Huth, 2021/05/10
- [PULL 3/9] pc-bios/s390-ccw: Use reset_psw pointer instead of hard-coded null pointer, Thomas Huth, 2021/05/10
- [PULL 5/9] pc-bios/s390-ccw: Silence warning from Clang by marking panic() as noreturn,
Thomas Huth <=
- [PULL 4/9] pc-bios/s390-ccw/netboot: Use "-Wl, " prefix to pass parameter to the linker, Thomas Huth, 2021/05/10
- [PULL 7/9] pc-bios/s390-ccw: Silence GCC 11 stringop-overflow warning, Thomas Huth, 2021/05/10
- [PULL 6/9] pc-bios/s390-ccw: Fix the cc-option macro in the Makefile, Thomas Huth, 2021/05/10
- [PULL 8/9] pc-bios/s390-ccw: Allow building with Clang, too, Thomas Huth, 2021/05/10
- Re: [PULL 8/9] pc-bios/s390-ccw: Allow building with Clang, too, Philippe Mathieu-Daudé, 2021/05/12
[PULL 9/9] pc-bios/s390: Update the s390-ccw bios binaries with the Clang and other fixes, Thomas Huth, 2021/05/10