Change -Wmissing-declarations to -Wmissing-variable-declarations.

This is the switch, which clang uses.
Use %#N instead of %#T.
Remove %#T.

It is not used anymore, use %#N instead.
Replace internal_errorf() by panic() and remove the former.
Just remember the last input name, not a pointer to the full position_t, so we do not operate with stale pointers.
stdbool.h must not define bool, false and true for C++.
Simplify my_strcasecmp() to strcaseeq().

This avoids the (for our use case unimportant) wrong return value.
Correct comment.
Reduce code and string duplication in print_entity().
Reduce indentation.
Set the position of a preprocessor conditional in push_conditional().
Correct the stored position of #if{,n}def.
Put the entity kind into a local variable in record_entity().
Replace the only call to diagnosticf() by the new function notef().
Inline diagnosticvf() into its only caller diagnosticposvf() and rename the latter to the former.
Let warningf() return, whether the diagnostic was shown.
Use notef() to point to a prior position in several diagnostic messages.
Remove the format specifier %P from diagnostic messages.

Use separate notef() instead.
Simplify loops using fputc() to fwrite().
Correct position in error message.