Skip to contentSkip to conversation

enable checkers on grub-module-verifierxx

PATCH Superseded Robbie Harwood 1 participant 2 messages Oct 4, 2022

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover enable checkers on grub-module-verifierxx

Address Daniel's comments on previous version.

In particular, gcc (Debian 12.2.0-3) only warns when the redefinition is to a different value. It gets confused by the space, so just remove it. This causes

gcc -x c -fsyntax-only -Iinclude -I. util/grub-module-verifierXX.c

to build without warnings.

Interdiff attached.

Be well,
--Robbie

Peter Jones (1):
grub-module-verifierxx.c: enable running standalone checkers

 util/grub-module-verifier32.c | 2 ++
 util/grub-module-verifier64.c | 2 ++
 util/grub-module-verifierXX.c | 9 +++++++++
 3 files changed, 13 insertions(+)

Interdiff against v3:

Signature · 1 line
2.35.1
#1 lore raw

PATCH v4 1/1 grub-module-verifierxx.c: enable running standalone checkers

From: Peter Jones <[email protected]>

Allow treating grub-module-verifierxx.c as a file you can build directly so syntax checkers like vim's "syntastic" plugin, which uses "gcc -x c -fsyntax-only" to build it, will work.

One still has to do whatever setup is required to make it pick the right include dirs, which -I options we use, etc., but this makes it so you can do the checking on the file you're editing, rather than on a different file.

---
 util/grub-module-verifier32.c | 2 ++
 util/grub-module-verifier64.c | 2 ++
 util/grub-module-verifierXX.c | 9 +++++++++
 3 files changed, 13 insertions(+)
util/grub-module-verifier32.c +2 -0
index 257229f8f0..ba7d41aafe 100644
@@ -1,2 +1,4 @@
 #define MODULEVERIFIER_ELF32 1
+#ifndef GRUB_MODULE_VERIFIERXX
 #include "grub-module-verifierXX.c"
+#endif
util/grub-module-verifier64.c +2 -0
index 4db6b4bedd..fc23ef800b 100644
@@ -1,2 +1,4 @@
 #define MODULEVERIFIER_ELF64 1
+#ifndef GRUB_MODULE_VERIFIERXX
 #include "grub-module-verifierXX.c"
+#endif
util/grub-module-verifierXX.c +9 -0
index 8e0cd91d90..d5907f268e 100644
@@ -1,3 +1,12 @@
+#define GRUB_MODULE_VERIFIERXX
+#if !defined(MODULEVERIFIER_ELF32) && !defined(MODULEVERIFIER_ELF64)
+#if __SIZEOF_POINTER__ == 8
+#include "grub-module-verifier64.c"
+#else
+#include "grub-module-verifier32.c"
+#endif
+#endif
+
 #include <string.h>
 
 #include <grub/elf.h>
Signature · 1 line
2.35.1