ForNeVeR / ForNeVeR/Cesium

Drop special treatment of functions with the empty parameter list

Open
#556 2 comments 1 reaction 0 assignees View on GitHub
area:compiler area:standard-support kind:feature status:help-wanted
Dominant language
C#
Stars
451
Forks
49
Avg merge
13h 59m
Merged PRs (30d)
6

Description

C23 has dropped the requirement of special treatment for the functions with empty parameter list, such as:
```c
void foo();
```

In previous versions of the standard, this would introduce a function declaration with a lax parameter list, meaning the caller can call it while passing any parameters.

In C23, this is no longer the case, and declarations such as `void foo();` and `void foo(void);` are strictly identical: they declare a function with no parameters.

For a summary of changes, see **Annex M, M.2 Fifth Edition**:
> Major changes in this fifth edition (`__STDC_VERSION__ 202311L`) include:
> - …
> - mandated function declarations whose parameter list is empty be treated the same as a parameter list which only contain a single `void`;

See also proposal [N2841](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm) that's been accepted.

This unfortunate behavior has been causing a fair amount of pain for implementing the previous standard versions in Cesium, so I am glad we could finally drop it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.