Re: [PATCH 2/3] Add default implementation of fenv.h and all methods

"Howland, Craig D. - US via newlib" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
> From: [email protected] <[email protected]> on behalf of Joel Sherrill <[email protected]>
> Sent: Wednesday, July 31, 2019 7:13 PM
> To: [email protected]
> Cc: Joel Sherrill
> Subject: [PATCH 2/3] Add default implementation of fenv.h and all methods
>
>         The default implementation of the fenv.h methods return
>         -EOPNOTSUPP.
>
>         The intention of the new fenv.h is that it be portable
>         and that architectures provide their own implementation
>         of sys/fenv.h.
> ...

The RISC-V-specific things would probably be best removed from libc/include/sys/fenv.h, leaving the original one in machine (unlike the primary fenv.h, which will no longer need to be under machine, as you noted.)  At a glance, using shorthand:
-#define FE_TONEAREST_MM 0x00000004
-#define FE_RMODE_MASK   0x7
(Put another way, it should only have the bare-bones items defined in C and POSIX.)
 
In general:
+  return -EOPNOTSUPP;
     ENOTSUP, not EOPNOTSUPP.  (The latter appears first, so I'm guessing you searched on NOTSUP and just copied the wrong one).

I'd suggest comments in the .c files to say they are non-functional placeholders, even though that should be obvious.
 
While the fenv/Makefile stuff does set up the chewout files, there is no man page stuff in the C files to get.

libm/Makefile.am I think also needs:
-libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
+libm.dvi: targetdep.tex math/stmp-def complex/stmp-def fenv/stmp-def
+fenv/stmp-def: stmp-targetdep ; @true
(It is set up poorly for maintenance, as ideally you'd want these to be automatic from the SUBDIRS line.)

Craig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.