Skip to content

Commit 946b687

Browse files
committed
Update default compilation to C23 (from C11)
This is a no-op at this point, as C23 didn't really break anything. The prior selection of C11 was mostly aribtrary. At the time the first libtock-c build infrastructure was built, C17 hadn't been ratified yet, but we needed some newer stuff than C99 provided, so we explicitly set things to C11 (well, gnu11). We have an impending need for the new C23 `#embed` compiler directive, so this version bump lays the groundwork. Future PRs may also look at other new C23 features; there are many that are likely useful to libtock-c.
1 parent d52e1ab commit 946b687

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
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\

0 commit comments

Comments
 (0)