NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-vax/58228: <fenv.h> is not supported on VAX



>Number:         58228
>Category:       port-vax
>Synopsis:       <fenv.h> is not supported on VAX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 06 17:30:01 +0000 2024
>Originator:     Jason Thorpe
>Release:        NetBSD 10
>Organization:
Just the BASICs
>Environment:
NetBSD vax3900 10.0_RC1 NetBSD 10.0_RC1 (GENERIC) #0: Wed Nov 29 12:36:24 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/vax/compile/GENERIC vax
>Description:
Imagine my immense sadness when building my Tiny-ish BASIC interpreter for NetBSD/vax, I was greeted with:

vax3900:thorpej 19$ make
../tbasm/tbasm -H tbvm_program.asm
parsed 384 instructions (128 labels, 218 references)
program size: 1115 bytes
cc -Os -g -Wall -Wformat   -c tbvm.c -o tbvm.o
In file included from tbvm.c:41:
/usr/include/fenv.h:34:4: error: #error "fenv.h is currently not supported for this architecture"
   34 | #  error "fenv.h is currently not supported for this architecture"
      |    ^~~~~
tbvm.c:42: warning: ignoring '#pragma STDC FENV_ACCESS' [-Wunknown-pragmas]
   42 | #pragma STDC FENV_ACCESS ON
      | 
tbvm.c: In function 'check_math_error':
tbvm.c:817:19: error: 'FE_UNDERFLOW' undeclared (first use in this function); did you mean 'UNDERFLOW'?
  817 |      fetestexcept(FE_UNDERFLOW|FE_OVERFLOW|FE_DIVBYZERO|FE_INVALID);
      |                   ^~~~~~~~~~~~
      |                   UNDERFLOW
tbvm.c:817:19: note: each undeclared identifier is reported only once for each function it appears in
tbvm.c:817:32: error: 'FE_OVERFLOW' undeclared (first use in this function); did you mean 'EOVERFLOW'?
  817 |      fetestexcept(FE_UNDERFLOW|FE_OVERFLOW|FE_DIVBYZERO|FE_INVALID);
      |                                ^~~~~~~~~~~
      |                                EOVERFLOW
tbvm.c:817:44: error: 'FE_DIVBYZERO' undeclared (first use in this function); did you mean 'FP_DIRTYZERO'?
  817 |      fetestexcept(FE_UNDERFLOW|FE_OVERFLOW|FE_DIVBYZERO|FE_INVALID);
      |                                            ^~~~~~~~~~~~
      |                                            FP_DIRTYZERO
tbvm.c:817:57: error: 'FE_INVALID' undeclared (first use in this function); did you mean 'EINVAL'?
  817 |      fetestexcept(FE_UNDERFLOW|FE_OVERFLOW|FE_DIVBYZERO|FE_INVALID);
      |                                                         ^~~~~~~~~~
      |                                                         EINVAL
tbvm.c:823:16: error: 'FE_ALL_EXCEPT' undeclared (first use in this function)
  823 |  feclearexcept(FE_ALL_EXCEPT);
      |                ^~~~~~~~~~~~~
tbvm.c: In function 'tbvm_runprog':
tbvm.c:4097:16: error: 'FE_ALL_EXCEPT' undeclared (first use in this function)
 4097 |  feclearexcept(FE_ALL_EXCEPT);
      |                ^~~~~~~~~~~~~
*** Error code 1

Stop.
make: stopped in /home/thorpej/JTTB/tbvm
vax3900:thorpej 20$ 

>How-To-Repeat:
Try to use <fenv.h> to detect arithmetic exceptions.  I'm sure there are test programs already in the ATF test suite.
>Fix:
Yes, please!



Home | Main Index | Thread Index | Old Index