Skip to main content

Questions tagged [c23]

C23 is the informal name of the next standard of the C programming language. It replaces C17 and introduces some new features.

7 questions with no upvoted or accepted answers
17 votes
0 answers
319 views

realloc(ptr, 0) in C23 - now what?

According to the change log of C23, proposal n2464 was voted-in and implemented, making realloc(ptr, 0) explicitly undefined behavior, whereas it was supposedly implementation-defined in previous ...
Lundin's user avatar
  • 208k
4 votes
0 answers
94 views

Is there such a thing as "function attribute correctness"?

Ok so C23 adds function attributes to the language but I'm not sure if anyone actually considered how they are supposed to be used. Consider this example: [[deprecated]] int foo () { return 0; } [[...
Lundin's user avatar
  • 208k
2 votes
0 answers
98 views

Why are there sequence point guarantees for C library functions?

I am looking at the C23 draft standard, but I think this would apply in C11 as well. There are several guarantees about sequence points in relation to function calls in C, such as before the return of ...
Kyle's user avatar
  • 990
2 votes
0 answers
1k views

Is there any difference between the C23 _BitInt() and a non-bit-precise integer of the same width?

The upcoming C23 Standard adds a keyword _BitInt() which can be used, as I understand, to define an integer with a specific number of bits. However I could not find much information with regards to ...
CPlus's user avatar
  • 4,378
1 vote
0 answers
66 views

Semantics of functions taking a QChar * when passed a void * or const void *

This is a follow-up to: What is the new QChar* in C23?, where @Lundin showed a sample implementation of a function that takes a QChar * with _Generic, after which I implemented strchrnul() like so: #...
Harith's user avatar
  • 7,235
0 votes
0 answers
46 views

Restrictions on auto keyword for type inference in C2X

int main() { auto status = 203; auto static const str = "Hello"; auto static const strs = {"Hello", "World"}; return status; } From playing around with ...
Harith's user avatar
  • 7,235
0 votes
0 answers
99 views

why weak attribute has not been selected for C23?

I can see that there is a new keyword type 'attributes' in C23. Some of it, like [[deprecated]] were used in C11+GNU __attribute__((deprecated)). I looks like a great update. I wonder why a usefull ...
Guillaume D's user avatar
  • 2,288