On Aug 15, 2024, at 7:09 PM, Fred Cisin via cctalk
<cctalk(a)classiccmp.org> wrote:
On Thu, 15 Aug 2024, Paul Koning via cctalk wrote:
>> I don't know about the VAX,but my
gripe is the x86 and the 68000 don't
>> automaticaly promote smaller data types to larger ones. What little
>> programming I have done was in C never cared about that detail.
>> Now I can see way it is hard to generate good code in C when all the
>> CPU's are brain dead in that aspect.
It is not the hardware that is at fault.
If anybody else is to blame, it is the compiler.
More likely the language designers, assuming the compiler doesn't have a standards
violation in its code. In the case of C, the type promotion rules that were just
explained are rather bizarre and surprising. Other languages do it differently, with
perhaps fewer surprises. Some define it very carefully (ALGOL 68 comes to mind), some not
so much.
paul