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 clang is confusing me.
- Compiling the above with gcc (trunk)
-std=c2x -pedantic-errors -Wall -Wextra
:
no diagnostics. - Compiling the above with clang 16.0.0
-std=c2x -pedantic-errors -Wall -Wextra
:
no diagnostics. - Compiling the above with clang 16.0.0
-pedantic-errors -Wall -Wextra
:error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
How am I to make any sense of this? I can understand if gcc has not yet implemented this, since C23 is after all not yet released, but why is clang giving the warning when I don't specify -std=c2x
?