🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Eggert Mon, 02 Nov 1992 22:08
enquire 4.3 (GCC 2.3.1) generates some garbage bits in float.h
#45
Author: Paul Eggert
Date: Mon, 02 Nov 1992 22:08
38 lines
2208 bytes
enquire 4.3, as distributed with GCC 2.3.1, generates some garbage bits in
float.h (sparc, SunOS 4.1.2).  This causes spurious failures in regression
tests.  For example, I generated float.h twice and got the following spurious
difference report:

diff /reb0.1/sun4c-4.1.2/lib/gcc-lib/sparc-sun/2.3.1/include/float.h float.h
64c64
< #define LDBL_MIN (__extension__ ((union __convert_long_double) {0x100000, 0x0, 0x8000000, 0xf82b8000}).__convert_long_double_d)
---
> #define LDBL_MIN (__extension__ ((union __convert_long_double) {0x100000, 0x0, 0x8000000, 0xf8290000}).__convert_long_double_d)
70c70
< #define LDBL_MAX (__extension__ ((union __convert_long_double) {0x7fefffff, 0xffffffff, 0x8000000, 0xf82b8000}).__convert_long_double_d)
---
> #define LDBL_MAX (__extension__ ((union __convert_long_double) {0x7fefffff, 0xffffffff, 0x8000000, 0xf8290000}).__convert_long_double_d)

On a sparc, a long double is only two integers long, so the last two integers
of LDBL_MIN and LDBL_MAX are garbage.


Here is a patch.

===================================================================
RCS file: RCS/enquire.c,v
retrieving revision 4.3
retrieving revision 4.3.1.1
diff -c -r4.3 -r4.3.1.1
*** enquire.c	1992/07/31 06:29:07	4.3
--- enquire.c	1992/11/02 21:49:19	4.3.1.1
***************
*** 906,911 ****
--- 906,912 ----
  char *fake_f_rep(type, val) char *type; Long_double val; {
  	static char buf[1024];
  	union { int i[4]; Long_double ld;} u;
+ 	u.i[0] = u.i[1] = u.i[2] = u.i[3] = 0;
  	u.ld = val;
  	sprintf(buf, "(__extension__ ((union __convert_long_double) {0x%x, 0x%x, 0x%x, 0x%x}).__convert_long_double_d)",
  		u.i[0], u.i[1], u.i[2], u.i[3]);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads