[Cfp-interest] (SC22WG14.14280) Is return of same type convertFormat or copy?
Jim Thomas
jaswthomas at sbcglobal.net
Tue Jun 21 13:56:44 PDT 2016
Would it be sufficient to append a sentence to F.3#3 (specified in Part 1) to say
“If the return expression of a return statement is evaluated to the floating-point format of the return type, it is implementation-defined whether a convertFormat operation is applied to the result of the return expression.”
Jim Thomas
> On Jun 11, 2016, at 3:16 PM, Joseph Myers <joseph at codesourcery.com> wrote:
>
> TS 18661-1 says "Whether C assignment (6.5.16) (and conversion as if by
> assignment) to the same format is an IEC 60559 convertFormat or copy
> operation is implementation-defined, even if <fenv.h> defines the macro
> FE_SNANS_ALWAYS_SIGNAL (F.2.1).".
>
> Does this apply to function return, where the return type of the function
> is the same as the type of the expression passed to the return statement
> and no wider evaluation format is in use - that is, may this act as either
> convertFormat or copy? C11 F.6 clearly envisages that such a return
> statement may do a conversion to the same type in the case of wider
> evaluation formats. But 6.8.6.4#3 only refers to conversions "If the
> expression has a type different from the return type of the function in
> which it appears".
>
> --
> Joseph S. Myers
> joseph at codesourcery.com
More information about the Cfp-interest
mailing list