Paul Schlie wrote:

- agreed, and thereby objects having no legitimate trap representation,
such as most if not all implementations of integers and floating point
objects on most if not all current target machines, and thereby their
access does not invoke an undefined behavior.

First of all, trap representations of COURSE exist for floating-point
objects, I guess you don't know fpt formats (most people don't).

But in any case, your reasoning here is once again based on the language
you wish you had, rather than the formal semantic language defined by
the standard, which has no notion of "no legitimate trap representation".

The standard says an uninitialized variable can have a trap
representation. Therefor it can. There is no license to reason about
how you think code is generated, any compiled is allowed to generate
code AS IF a trap representation were present. I think you often miss
this distinction between

generated code at the implementation level

as if behavior from the rules in the standard

Just as:

 volatile int* port = (int*)PORT_ADDRESS;

 int input = *port; supposedly invoking an undefined behavior.

is required to be well specified, effectively reading through a pointer
an un-initialized object's value, and then assigning that unspecified value
to the variable input; as otherwise the language couldn't be utilized to
write even the most hardware drivers required of all computer systems.

Looks unspecified to me, but in any case reasoning which says

The standard must say X, since otherwise I could not write "hardware
drivers required of all computer systems", is bogus. There is nothing
that says valid C can be used to write such drivers.

(however regardless, I acquiesce to those to continue to wish otherwise,
to the apparent continued destruction of the language for no apparent
particularly useful purpose by increasingly striving to render it
undefined)

It is not a matter of wishes (though you seem to work this way), it is
a matter of what the standard says. If you don't like the standard, go
argue with the standards committee, it is useless to argue with
implementors.


Reply via email to