diff options
| author | 2026-04-14 18:40:42 +0200 | |
|---|---|---|
| committer | 2026-04-14 18:40:42 +0200 | |
| commit | cbf1018b21ea2a060a3825fbdb1453800b5b7320 (patch) | |
| tree | 1a0f753f16fa93c8c0fbc62f4c8c83c7f622d4ab /.editorconfig | |
| parent | 98222b7c0506b0a9833230177b939f8c25046b31 (diff) | |
c: make type of conditional expr with pointers match non void pointer
Here's what the C standard[1] says about the conditional operator:
```
if one operand is a null pointer constant, the result has the type of
the other operand; otherwise, one operand is a pointer to void or a
qualified version of void, in which case the result type is a
pointer to an appropriately qualified version of void.
``
But actually, some codebases rely on things like 'x ? &foo.memb : NULL'
to have the type of `&foo.memb`, and not `void *`...
[1]: ISO/IEC 9899:TC3 ยง6.5.15
Diffstat (limited to '.editorconfig')
0 files changed, 0 insertions, 0 deletions