Liste des Groupes | Revenir à c arch |
If the loop variable
represents degrees C or F, or some other naturally signed measure it
should be signed (or maybe floating point).
What kind of loop it
is, whether ascending or descending, or what the increment is, etc,
is secondary; a more important factor is what sort of value is
being represented, and in almost all cases that is what should
determine the type used.
Bringing it back to "architecture" Like Anton Ertl has said, LP64 for>
C/C++ is a mistake. It should always have been ILP64, and this nonsense
would go away. Any new architecture should make C ILP64 (looking at you
RISC-V, missing yet another opportunity to not make the same mistakes as
everyone else).
I believe this view is shortsighted. The big mistake is developers
hardcoding types everywhere - especially int, but also long, and
their unsigned variants. It's almost never a good idea to hardcode
a specific width (eg, uint32_t) in a type name used for parameters
or local variables, but that is by far a very common practice.
Les messages affichés proviennent d'usenet.