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

--- Comment #16 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Wed, 26 Sep 2018, vincent-gcc at vinc17 dot net wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87390
> 
> --- Comment #14 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
> (In reply to jos...@codesourcery.com from comment #13)
> > On Wed, 26 Sep 2018, vincent-gcc at vinc17 dot net wrote:
> > 
> > > But there are no differences with 6.3.1.4 (when converting to a floating 
> > > type):
> > > in both cases, either the value can be represented exactly, in which case 
> > > it is
> > > unchanged, or it cannot, in which case it is rounded. When doing a 
> > > conversion
> > > to some given type, the C standard does not care of the origin type of the
> > > value.
> > 
> > In 6.3.1.5 in C99, that distinction is only applied in the case of
> 
> which distinction?

The one you made above, between values that can be represented in the 
target type, and those that cannot and are thus rounded.

> > demotions and explicit conversions (second paragraph); it does not apply 
> > in the first paragraph (implicit promotions).  I.e., the 6.3.1.4 handling 
> > of conversions from integer to floating-point is analogous to the 6.3.1.5 
> > second paragraph handling of demotions and explicit conversions from 
> > floating-point to floating-point (not to the first paragraph handling of 
> > implicit promotions).
> 
> Analogous? Where does the C standard say that?

It doesn't say so directly.  Rather, if you apply your comparison 
(comment#12) of 6.3.1.4 and 6.3.1.5 ("in both cases, either the value can 
be represented exactly, in which case it is unchanged, or it cannot, in 
which case it is rounded"), I think it has to be one of 6.3.1.4 with 
6.3.1.5 paragraph 2, and in 6.3.1.5 paragraph 2 there is no excess 
precision in the result of the conversion.

I see no reason here, if someone has explicitly chosen an old standard 
mode (-std=c99), to deviate from the interpretations of ambiguities used 
since excess precision support was first added, given that the changes in 
C11 did not results from the Defect Report process but from a separate 
paper outside of that process.

Reply via email to