File mflash-add-missing-stlib-include.patch of Package mstflint
commit df180102768284a7223ada6d7243531f9e9be2c7
Author: Nicolas Morey <nmorey@suse.com>
Date: Thu Sep 5 14:08:06 2024 +0200
mflash: add missing stlib include
Add missing include to fix GCC 14 build error:
In file included from mflash_dev_capability.c:42:
mflash_dev_capability.c: In function 'get_flash_gen':
mflash_dev_capability.h:67:27: error: implicit declaration of function 'getenv' [-Wimplicit-function-declaration]
67 | char* reacDebug = getenv("FLASH_DEBUG"); \
| ^~~~~~
mflash_dev_capability.c:186:5: note: in expansion of macro 'DPRINTF'
186 | DPRINTF(("get_flash_gen: flash_gen = %d\n", gen));
| ^~~~~~~
mflash_dev_capability.c:43:1: note: 'getenv' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>'
42 | #include "mflash_dev_capability.h"
+++ |+#include <stdlib.h>
43 |
mflash_dev_capability.h:67:27: error: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
67 | char* reacDebug = getenv("FLASH_DEBUG"); \
| ^~~~~~
mflash_dev_capability.c:186:5: note: in expansion of macro 'DPRINTF'
186 | DPRINTF(("get_flash_gen: flash_gen = %d\n", gen));
| ^~~~~~~
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git mflash/mflash_dev_capability.h mflash/mflash_dev_capability.h
index d63b7cffaf90..ce850a982d84 100644
--- mflash/mflash_dev_capability.h
+++ mflash/mflash_dev_capability.h
@@ -42,6 +42,7 @@
#ifndef USER_MFLASH_MFLASH_DEV_CAPABILITY_H_
#define USER_MFLASH_MFLASH_DEV_CAPABILITY_H_
+#include <stdlib.h>
#include "mflash_pack_layer.h"
#ifndef UEFI_BUILD