Consider the following:
typedef int; int main () { return 0; }
If I compile this with clang without any warnings, I get
warning: typedef requires a name [-Wmissing-declarations] typedef int;
What to expect; typedef int is illegal in section 6.7 of the C11 standard and in section 5.1.1.3,
The corresponding implementation should produce at least one diagnostic message if the translation unit or translation unit contains a violation of any syntax rule or restriction.
If I compile this with clang -Wno-missing-declarations , it compiles clean, without any diagnostic messages.
My question is:
Is this label as an inappropriate implementation, or is it normal to provide the ability to disable what would otherwise be a mandatory diagnostic?
source share