[Cfp-interest 2931] Re: issue about type-generic macros and new augmented arithmetic header

Jim Thomas jaswthomas at sbcglobal.net
Sat Oct 21 14:52:40 PDT 2023


On further thought, type-generic macros for augmented arithmetic seem problematic. The user must figure out the type that will be determined from the macro arguments in order to pick the right struct to match the return type. For example, with

_Float64 f64;
_Float32x f32x;

the return type for augadd(f64, f32x) might be struct f64aug_t or struct f32xaug_t, depending on the implementation’s format for _Float32x.

I think we’re left with option 3, and the need to remove the type-generic macros for augmented arithmetic from the current draft of TS-4 (without new headers) before sending it to WG14.

- Jim Thomas

> On Oct 21, 2023, at 11:47 AM, Jim Thomas <jaswthomas at sbcglobal.net> wrote:
> 
> This is about an issue that arose in reworking TS-4r to use new headers. The current draft of TS-4r adds augmented-arithmetic functions to <math.h> and type-generic macros for them to <tgmath.h>. The draft in progress has the augmented arithmetic functions in a new header <augarith.h>. The issue is, what to do with their type-generic macros?
> 
> Adding new macros to <tgmath.h> in contrary to our given direction to introduce new identifiers in new headers.
> 
> Adding type-generic macros, along with the functions, unconditionally to <augarith.h> would have the effect of overriding the functions.
> 
> These resolution options came to mind:
> 
> 1. Add the type generic macros to <augarith.h> conditioned by a user-defined WANT macro, e.g. __STDC_WANT_TGAUGARITH__.
> 
> 2. Add the type generic macros to <augarith.h> conditioned by whether <tgmath.h> has been included.
> 
> 3. Remove the type-generic macros for augmented arithmetic from the TS.
> 
> Your thoughts?
> 
> - JIm Thomas
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20231021/5a97cc8c/attachment.htm>


More information about the Cfp-interest mailing list