> It is not the hardware that is at fault.
> If anybody else is to blame, it is the compiler.
On Thu, 15 Aug 2024, Paul Koning wrote:
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.
C very explicitly leaves some thing undefined, supposedly to work with
more machines, and Kernighan & Ritchie say that it is the responsibility
of the programmer to create unambiguous code.
for example, evaluation of expressions in the lvalue might be done before
OR after evaluation of expressions in th rvalue
Some other languages are much stricter on types, etc. and have fewer
ambiguities.