This bug raises 2 questions:
* Is --with-kerneldir used and useful ? all our ipmitool builds have
been done without kernel headers available on the build platform, if
not, the build cannot pass
* Do we have to fix the linux kernel header stddef.h to avoid conflict with
true|false begin already defined ?
** Description changed:
On Questing 25.10 (but also older releases)
ipmitool is built with -std=gnu11
- this will enable the include path:
+ the fact that gnu11 is used, this will enable the include path (with
+ multiple layers of macros definitions : _GNU_SOURCE -> _DEFAULT_SOURCE
+ -> _USE_MISC):
In file included from /usr/include/linux/posix_types.h:4,
from /usr/include/asm-generic/socket.h:5,
from /usr/include/x86_64-linux-gnu/asm/socket.h:1,
from /usr/include/x86_64-linux-gnu/bits/socket.h:392,
from /usr/include/x86_64-linux-gnu/sys/socket.h:33,
from /usr/include/netinet/in.h:23,
from ../include/ipmitool/ipmi.h:39,
from ipmi_sel.c:44:
and causes the build failure:
/lib/modules/6.17.0-7-generic/build/include/linux/stddef.h:11:9: error:
expected identifier before numeric constant
11 | false = 0,
| ^~~~~
This is because <stdbool.h> has been included before <stddef.h> and
- already defines true and false
+ already defines true and false.
+
+ In stdbool.h:
+
+ #if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+ /* bool, true and false are keywords. */
+ #else
+ #define bool _Bool
+ #define true 1
+ #define false 0
+ #endif
+
+
+ In kernel stddef.h:
+
+ enum {
+ false = 0,
+ true = 1
+ };
** Description changed:
On Questing 25.10 (but also older releases)
- ipmitool is built with -std=gnu11
+ ipmitool is built with -std=gnu11 and configured with --with-kerneldir
the fact that gnu11 is used, this will enable the include path (with
multiple layers of macros definitions : _GNU_SOURCE -> _DEFAULT_SOURCE
-> _USE_MISC):
In file included from /usr/include/linux/posix_types.h:4,
from /usr/include/asm-generic/socket.h:5,
from /usr/include/x86_64-linux-gnu/asm/socket.h:1,
from /usr/include/x86_64-linux-gnu/bits/socket.h:392,
from /usr/include/x86_64-linux-gnu/sys/socket.h:33,
from /usr/include/netinet/in.h:23,
from ../include/ipmitool/ipmi.h:39,
from ipmi_sel.c:44:
and causes the build failure:
/lib/modules/6.17.0-7-generic/build/include/linux/stddef.h:11:9: error:
expected identifier before numeric constant
11 | false = 0,
| ^~~~~
This is because <stdbool.h> has been included before <stddef.h> and
already defines true and false.
In stdbool.h:
#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
/* bool, true and false are keywords. */
#else
#define bool _Bool
#define true 1
#define false 0
#endif
-
In kernel stddef.h:
enum {
- false = 0,
- true = 1
+ false = 0,
+ true = 1
};
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2133161
Title:
FTBFS because of kernel headers stddef.h defining true/false
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ipmitool/+bug/2133161/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs