realise that tgmath.h is a time sink

This commit is contained in:
bumbread 2022-08-06 23:36:16 +11:00
parent 0337c383b3
commit 5e96c041ba
3 changed files with 12 additions and 8 deletions

View File

@ -23,7 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdnoreturn.h> #include <stdnoreturn.h>
#include <string.h> #include <string.h>
#include <tgmath.h> // #include <tgmath.h>
#include <threads.h> #include <threads.h>
#include <time.h> #include <time.h>
#include <uchar.h> #include <uchar.h>

View File

@ -1,11 +1,5 @@
#include <stdio.h> #include <std.h>
#include <math.h>
#include <float.h>
#include <fenv.h>
#include <inttypes.h>
#include <errno.h>
#include <limits.h>
const char *show_classification(double x) { const char *show_classification(double x) {
switch(fpclassify(x)) { switch(fpclassify(x)) {

10
todo
View File

@ -72,6 +72,16 @@ string.h:
* strerror_s * strerror_s
* strerrorlen_s * strerrorlen_s
tgmath.h:
* Due to the use of conditional operator in type-generic macros the
expression always expands to the value of type `long double`. This leads
to warnings when used with printf, e.g. as in printf("%f\n", exp(0)).
Using _Generic macros isn't a good choice either, because it won't work
with typedef'd types.
In other words there's no pure-C way to do tgmath.h.
That's probably the reason msvc stdlib headers don't implement tgmath.h.
clang implements it with __attribute__((__overloadable__)).
threads.h: threads.h:
* TODO: add todo items * TODO: add todo items