Skip to content

Conversation

@dinuxbg
Copy link

@dinuxbg dinuxbg commented Jan 26, 2025

Fix GCC build when using -std=gnu23 option.

Fix GCC build when using -std=gnu23 option.

Signed-off-by: Dimitar Dimitrov <[email protected]>
dinuxbg pushed a commit to dinuxbg/gnupru that referenced this pull request May 4, 2025
Workaround for embench/embench-iot#207

Signed-off-by: Dimitar Dimitrov <[email protected]>
@Wren6991
Copy link

I hit the same issue. Can confirm this fix works. An alternative is to just use stdbool

diff --git a/src/wikisort/libwikisort.c b/src/wikisort/libwikisort.c
index 4bdc701..3810f88 100644
--- a/src/wikisort/libwikisort.c
+++ b/src/wikisort/libwikisort.c
@@ -28,13 +28,7 @@
 #include <string.h>
 #include <math.h>
 #include <limits.h>
-
-/* various #defines for the C code */
-#ifndef true
-#define true 1
-#define false 0
-typedef uint8_t bool;
-#endif
+#include <stdbool.h>
 
 #define Var(name, value, type) type name = value

Without one of these patches, this benchmark fails to compile by default on GCC 15 (where C23 is the default version now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants