Skip to contentSkip to conversation

makedumpfile: Fix a couple of warnings

PATCH In review Petr Tesarik 2 participants 4 messages Apr 15, 2023 – Apr 17, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover makedumpfile: Fix a couple of warnings

Although none of the warnings is a real issue, they clutter the build output, making it easier to overlook another, real issue.

Petr Tesarik (2):
eppic: Fix incompatible pointer type warnings
eppic: Fix a warning about redefining ERRMSG

 extension_eppic.c | 4 ++--
 extension_eppic.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 7 lines
2.40.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw

PATCH 1/2 eppic: Fix incompatible pointer type warnings

From: Petr Tesarik <[email protected]>

On Linux, eppic defines ull (a bit confusingly) as uint64_t. This is an unsigned long on 64-bit platforms with both GCC and LLVM, and the compiler complains about passing a pointer to an unsigned long where a pointer to an unsigned long long is expected.

It is not a real bug, because both types are identical on 64-bit platforms, and on 32-bit platforms, uint64_t denotes an unsigned long long, but the warning is annoying.

---
 extension_eppic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extension_eppic.c +2 -2
index 45bc032..8aa9ed2 100644
@@ -122,7 +122,7 @@ drilldown(ull offset, type_t *t)
 {
 	int type_flag, len = 0, t_len = 0, nidx = 0;
 	int fctflg = 0, ref = 0, *idxlst = 0;
-	ull die_off = offset, t_die_off;
+	unsigned long long die_off = offset, t_die_off;
 	char *tstr = NULL, *tstr_dup = NULL;
 
 	while (GET_DIE_ATTR_TYPE(die_off, &type_flag, &t_die_off)) {
@@ -221,7 +221,7 @@ apimember(char *mname, ull idx, type_t *tm, member_t *m, ull *last_index)
 	int index, nfields = -1, size;
 	int nbits = 0, fbits = 0;
 	long offset;
-	ull m_die, die_off = idx;
+	unsigned long long m_die, die_off = idx;
 	char *name = NULL;
 
 	nfields = GET_DIE_NFIELDS_ALL(die_off);
Signature · 7 lines
2.40.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw

PATCH 2/2 eppic: Fix a warning about redefining ERRMSG

In reply to Petr Tesarik

The macro is redefined on purpose, so let's #undef it first to silence the warning.

---
 extension_eppic.h | 1 +
 1 file changed, 1 insertion(+)
extension_eppic.h +1 -0
index 24189ba..08f1db0 100644
@@ -71,6 +71,7 @@ typedef TYPE_S {
 	ull rtype;  /* type_t a reference refers too */
 } type_t;
 
+#undef ERRMSG
 #define ERRMSG(x...) \
 do { \
 		fprintf(stderr, __FUNCTION__); \
Signature · 7 lines
2.40.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
In reply to Petr Tesarik
Quoted 2 lines · Petr Tesarik

Although none of the warnings is a real issue, they clutter the build output, making it easier to overlook another, real issue.

Agree, applied the two patches.
https://github.com/makedumpfile/makedumpfile/compare/58553ad...8e8b881

Thanks!
Kazu

Quoted 9 lines

Petr Tesarik (2):
eppic: Fix incompatible pointer type warnings
eppic: Fix a warning about redefining ERRMSG

  extension_eppic.c | 4 ++--
  extension_eppic.h | 1 +
  2 files changed, 3 insertions(+), 2 deletions(-)

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec