Skip to content

Commit b9ccccf

Browse files
authored
Merge pull request #502 from tock/bump-to-c23
Update default compilation to C23 (from C11)
2 parents 5508df7 + 47c51ca commit b9ccccf

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Configuration.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ endif
163163
# the dos/microsoft lineage chose `.cpp` to address this same issue, leading to
164164
# confusion nowadays about the meaning of 'cpp'.]
165165
override ASFLAGS += -mthumb
166-
override CFLAGS += -std=gnu11
166+
# '-gnu2x' is a deprecated alias for '-gnu23'. We're close enough in time still
167+
# (spring 2025) to the formal ratification of C23 (October 2024) that some
168+
# folks likely still have toolchains which only support the 2x _name_ for the
169+
# now-official C23 standard (even if the toolchain supports all the features
170+
# we care about under the 2x name). Eventually we should replace this with
171+
# explicit C23 selection.
172+
override CFLAGS += -std=gnu2x
167173
override CPPFLAGS += \
168174
-frecord-gcc-switches\
169175
-gdwarf-2\

examples/tests/crash_dummy/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
#include <libtock/interface/button.h>
44

5-
volatile int* nullptr = 0;
5+
volatile int* zeroptr = 0;
66

77
static void button_callback(__attribute__ ((unused)) returncode_t ret,
88
__attribute__ ((unused)) int btn_num,
99
__attribute__ ((unused)) bool val) {
10-
__attribute__ ((unused)) volatile int k = *nullptr;
10+
__attribute__ ((unused)) volatile int k = *zeroptr;
1111
}
1212

1313
int main(void) {

libtock-sync/display/text_screen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ static void text_screen_size_cb(returncode_t ret, uint32_t width, uint32_t heigh
2727
result_size.height = height;
2828
}
2929

30-
31-
static returncode_t text_screen_op(returncode_t (*op)()) {
30+
static returncode_t text_screen_op(returncode_t (*op)(void (*)(returncode_t))) {
3231
returncode_t ret;
3332
result.fired = false;
3433

0 commit comments

Comments
 (0)