c23 Questions
0
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 s...
Kaolinite asked 1/7, 2024 at 8:12
0
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...
Champaigne asked 23/5, 2024 at 4:17
1
Solved
Can I declare a C pointer with an intialization to its own address?
void* p = &p;
I am specifically concerned with if this is strictly standard compliant in C23 (as the draft currently stands)....
Coelostat asked 6/4, 2024 at 4:34
1
Solved
The new standard C (ISO/IEC 9899:2023, aka C23),
in the Annex H, several macros and types are defined,
relative to real and complex arithmetic,
subject to the standard ISO/IEC 60559
(floating-point...
Baillie asked 7/2, 2024 at 13:40
2
Solved
Latest gcc 13.x (trunk) gives a compiler error (gcc -std=c23) for this code:
int* p = false;
error: incompatible types when initializing type 'int *' using type '_Bool'
How can this be correct?
...
Seen asked 6/2, 2024 at 14:11
5
C23 introduced new semantics in function declarators:
6.7.6.3 Function declarators
[...]
13 For a function declarator without a parameter type list: the effect is as if it were declared with a p...
Quiche asked 20/11, 2023 at 22:56
1
Solved
While answering a question here, I made the following example:
#include <stdio.h>
#include <math.h>
int main (void)
{
float_t a = -248.75;
printf("%f\n", a);
unsigned ch...
Electrochemistry asked 19/10, 2023 at 13:29
5
In the following code, copyThing() is written so that its return value has the same type as its argument value:
extern void *copyThingImpl(const void *x);
#define copyThing(x) ((typeof(x)) copyThi...
2
Solved
Consider this union:
typedef union
{
void* vptr;
nullptr_t nptr;
} pun_intended;
nullptr_t is supposedly compatible with void* 1). Ok so what if we initialize the void* to some non-zero value?
p...
Coinsure asked 15/8, 2023 at 13:39
3
Solved
In C23, the nullptr keyword got standardized. I would prefer to use nullptr instead of NULL prior to C23 too because it means that I could write code which compiles in:
C, prior to C23
C, since C2...
Knighterrantry asked 14/8, 2023 at 14:19
1
Solved
The wording of the C23 working draft on unsequenced functions is unclear to me. Among other properties, unsequenced functions have to be independent:
(6) An object X is observed by a function call...
Aesthetics asked 7/8, 2023 at 14:46
1
Solved
C23 introduced the attributes [[reproducible]] and [[unsequenced]].
What is the motivation behind them?
How are they defined, and what effect do they have on a function?
What kind of functions sho...
Punak asked 6/8, 2023 at 21:51
3
Solved
C++11 added the constexpr keyword which can be added to functions to specify constant behavior.
C23 added what seems to be identical functionality in the form of the [[reproducible]] tag.
How are t...
1
Solved
C23 introduced a number of floating point types, including but not limited to:
_Float32
_Float32x
_Float32_t
I am unsure of the differences, such as:
Are they keywords, or are they type aliases,...
Conner asked 5/7, 2023 at 9:29
3
The C23 standard apparently has introduced using "auto" keyword for auto type deduction, see here, just like in C++11. However, there seems to be some differences.
According to here, http...
Fyrd asked 14/5, 2023 at 17:33
2
Solved
My program:
int main(){}
In upcoming C23, non-prototype and "K&R style" functions are removed. I realize that C23 is not yet formally released, but the current behavior of gcc and cl...
Phan asked 20/4, 2023 at 12:4
1
Solved
I'm currently reading the new draft of the C23 standard (N3088), and I've noticed that in §5.2.4.1 the standard states:
The implementation shall be able to translate and execute a program that use...
1
Solved
A new preprocessor directive is available in the upcoming C23 Standard: #embed
Here is a simple example:
// Placing a small image resource.
#include <stddef.h>
void show_icon(const unsigned...
Casillas asked 30/11, 2022 at 0:17
1
© 2022 - 2025 — McMap. All rights reserved.