Skip to contentSkip to conversation

cyclictest: Fix BUILD failure for GCC_VER < 14

PATCH Superseded Suneeth D 2 participants 3 messages Sep 2 – Sep 10

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Suneeth D

author
#0 lore raw

PATCH v2 1/1 cyclictest: Fix BUILD failure for GCC_VER < 14

timerthread() uses bool, true, and false. Those are keywords in C23, which became GCC's default in GCC 15 (-std=gnu23), so the file compiles there without stdbool.h. With the earlier versions of GCC the default is gnu17, where they are provided by <stdbool.h>, and the build fails without it.

Fixes 98fcd661ac59 (cyclictest: Acquire a lock before invoking pthread_cond_signal())

---

Changes since v1 ---> v2:

* Modify commit message to include Tomas Glozar's note on default changes happened since GCC 15.

based on: fd45df830803dd7f26d2ca8bdcf05fd7e0d62ae8 (rt-tests/main)

 src/cyclictest/cyclictest.c | 1 +
 1 file changed, 1 insertion(+)
src/cyclictest/cyclictest.c +1 -0
index 99194378f946..58b56bcede0f 100644
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · Suneeth D

timerthread() uses bool, true, and false. Those are keywords in C23, which became GCC's default in GCC 15 (-std=gnu23), so the file compiles there without stdbool.h. With the earlier versions of GCC the default is gnu17, where they are provided by <stdbool.h>, and the build fails without it.

Fixes 98fcd661ac59 (cyclictest: Acquire a lock before invoking pthread_cond_signal())
#2 lore raw
In reply to Suneeth D
Quoted 9 lines · Suneeth D

timerthread() uses bool, true, and false. Those are keywords in C23, which became GCC's default in GCC 15 (-std=gnu23), so the file compiles there without stdbool.h. With the earlier versions of GCC the default is gnu17, where they are provided by <stdbool.h>, and the build fails without it.

Fixes 98fcd661ac59 (cyclictest: Acquire a lock before invoking pthread_cond_signal())
Quoted 7 lines

---

Changes since v1 ---> v2:

* Modify commit message to include Tomas Glozar's note on default changes happened since GCC 15.