Why does C allows empty declarations? They're both explicitly allowed at the grammar level and only generate a warning if compiled.
The production declaration
, from the Annex A of the C standard, is allowing it at the grammar level:
declaration
= declaration_specifiers , ";"
| declaration_specifiers , init_declarator_list , ";"
| static_assert_declaration
;
(turned into EBNF
by me)