wrote:
> Should this be a warning/error? Why is this allowed?
You didn't tell your tool to behave like an ANSI/ISO conforming
implementation of C++.
Most C and C++ compilers enable their extensions by default. This means
that they can misinterpret or even reject some strictly conforming
programs, and fail to diagnose programs which require a diagnostic.
For any compiler you happen to be using, it behooves you to find out
how to make it behave in a conforming way.
With gcc, there are two flags for this: -ansi to disable the
non-conforming extensions, and -pedantic to request all required
diagnostics.
I have an installation of GCC 3.4.3 here.
The C front end, even without -ansi or -pedantic, diagnoses "uint16_t
short x" with this message:
error: long, short, signed or unsigned used invalidly for `x'
The C++ front end from 3.4.3, however, is silent, unless given
-pedantic, in which case it yields the same message.