https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114526

--- Comment #13 from Kaz Kylheku <kkylheku at gmail dot com> ---
(In reply to Joseph S. Myers from comment #11)
> I think that simply failing to say whether a value of type X may be
> converted to type Y is clearly enough for it at least to be unspecified
> whether or when such conversions are possible in a cast at all (which is
> enough for rejecting the translation unit).

"Unspecified (Behavior)" is a normative term though. Unspecified situations
occur when the standard gives the implementation a choice from among a finite
number of behaviors (none of those being anything like "stop the program", or
"behave unpredictably"), but the implementation is not required to document
which behavior is selected.

The difference between "unspecified" and "implementation-defined" is that under
the latter, the choice must be documented.

E.g. order of evaluation of function argument expressions is unspecified,
therefore we don't know whether G or H is called first in F(G(), H()), and the
implementation doesn't have to provide any documented requirements about it.

When the standard doesn't define a behavior, not mentioning any possible
choices or anything of the sort, it is undefined. "behave unpredictably" or
"stop the program" are possible behaviors then.

Reply via email to