boostorg / wave

Boost.org wave module
http://boost.org/libs/wave
21 stars 49 forks source link

C23 mode #184

Open spth opened 1 year ago

spth commented 1 year ago

AFAIK, wave currently has a C99 mode and various C++ modes. IMO, it would make sense to add a C23 mode (AFAIK some of the new C23 features are already supported in wave anyway, as extensions or as the corresponding C++ features).

jefftrull commented 1 year ago

Agreed 100%. It's a lot of work keeping up with the standard!

btw I just realized you are the primary SDCC maintainer, who I corresponded with about bitfields :) What do you use Wave for?

spth commented 1 year ago

I don't use it yet. SDCC uses a preprocessor based on the one from GCC. My impression is that GCC keep integrating its preprocessor tighter into the compiler, which makes it harder for us to maintain our fork of their preprocessor. clang has a reputation of the preprocessor being even more integrated than with GCC. A Wave-based preprocessor could be an alternative for SDCC in the long term. Clearly, a preprocessor for SDCC needs to be able to support all the C standards SDCC supports.

hkaiser commented 1 year ago

@spth Could you give us a list of features that you'd like to see implemented? Is it more than the #elifndef, #embed, and #warning directives?

spth commented 1 year ago

There is also #embed (https://github.com/boostorg/wave/issues/131).

P.S.: The comma-separated list implementation of #embed would be fine. SDCC targets small devices, so if the performance aspects of #embed matter to a user they are already using arrays bigger than what fits into the target device memory.