4 ms·
> This is not an error or even a warning by default! It depends on the compiler, for instance in Clang this is part of the default warning set: https://www.go
by flohofwoe 3y ago
> This is not an error or even a warning by default!
It depends on the compiler, for instance in Clang this is part of the default warning set:
https://www.godbolt.org/z/bKnq456eK https://www.godbolt.org/z/bKnq456eK
- vbezhenar 3y agogcc has that warning as well (not enabled by default, but enabled with -Wall). However gcc does not have a warning that I'm supposed to write `int foo(void){}` (if we're talking about C) which is real issue.
- astrange 3y agoNot true anymore in C2x, () means (void) now. The missing return type is still an issue though.
- flohofwoe 3y agoAh right. Clang will warn if you actually try to call such a () function with arguments: https://www.godbolt.org/z/qEa55PdG9 https://www.godbolt.org/z/qEa55PdG9 Both GCC and MSVC don't care though.