[Cfp-interest] implementing tgmath for constant rounding modes

Jim Thomas jaswthomas at sbcglobal.net
Wed Jun 13 14:39:55 PDT 2012


On Jun 11, 2012, at 9:06 PM, Fred J. Tydeman wrote:

> On Thu, 07 Jun 2012 19:22:20 -0400 Joel C. Salomon wrote:
>> 
>> Except that attributes were not accepted into C11.
> 
> OK, so make it a keyword and a Function specifier 
> like inline and _Noreturn.  Perhaps, _Roundwise
> 
>> Also, looking at <http://open-std.org/jtc1/sc22/wg14/www/docs/n1403.pdf>
>> where attributes for C++ are described, it does not seem to me that they
>> can be used in this way, only for declarations and listed control
>> constructs.
>> 
>> So you'd be left with including [[roundwise]] in the function
>> declaration, e.g.:
>> 
>>   double cbrt [[roundwise]] (double);
> 
> Or,
> 
> _Roundwise double cbrt(double);
> 

I don't see that an attribute or a keyword is helpful to the compiler. It can just as easily deal with a prefix on the function name, which would have the advantage of not impacting the language.

-Jim

> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (775) 358-9748      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list