Skip to contentSkip to conversation

dl: fix grub_dl_is_persistent() for EMU

PATCH In review Gary Lin via Grub-devel 2 participants 3 messages Jul 3, 2025 – Jul 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dl: fix grub_dl_is_persistent() for EMU

When attempting to build grub-emu, the compilation failed with the following error message:

include/grub/dl.h: In function ‘grub_dl_is_persistent’:
include/grub/dl.h:262:1: error: no return statement in function returning non-void [-Werror=return-type]

To avoid the erorr, make the function always return 0.

Fixes ba8eadde6be1 (dl: Provide a fake grub_dl_set_persistent() and grub_dl_is_persistent() for the emu target)
Cc Daniel Axtens <[email protected]>
Cc Sudhakar Kuppusamy <[email protected]>
---
 include/grub/dl.h | 1 +
 1 file changed, 1 insertion(+)
include/grub/dl.h +1 -0
index b8135c8f3..53bf9abdb 100644
@@ -259,6 +259,7 @@ grub_dl_set_persistent (grub_dl_t mod __attribute__((unused)))
 static inline int
 grub_dl_is_persistent (grub_dl_t mod __attribute__((unused)))
 {
+  return 0;
 }
 #else
 static inline void
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Gary Lin

When attempting to build grub-emu, the compilation failed with the following error message:

include/grub/dl.h: In function ‘grub_dl_is_persistent’:
include/grub/dl.h:262:1: error: no return statement in function returning non-void [-Werror=return-type]

To avoid the erorr, make the function always return 0.

Fixes ba8eadde6be1 (dl: Provide a fake grub_dl_set_persistent() and grub_dl_is_persistent() for the emu target)
Cc Daniel Axtens <[email protected]>
Cc Sudhakar Kuppusamy <[email protected]>

---
include/grub/dl.h | 1 +

1 file changed, 1 insertion(+)
include/grub/dl.h +0 -0
index b8135c8f3..53bf9abdb 100644
@@ -259,6 +259,7 @@ grub_dl_set_persistent (grub_dl_t mod __attribute__((unused)))
Quoted 10 lines

static inline int
grub_dl_is_persistent (grub_dl_t mod __attribute__((unused))) {
+ return 0;
}
#else
static inline void

Signature · 1 line
2.43.0

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel