delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/07/20/03:39:27

From: "Andrew Cottrell" <AndrewCottrell AT swiftdsl DOT com DOT au>
To: "'Charles Sandmann'" <sandmann AT clio DOT rice DOT edu>,
"Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
Cc: <djgpp-workers AT delorie DOT com>
Subject: RE: libm build problem
Date: Sun, 20 Jul 2003 17:15:46 +1000
Message-ID: <000c01c34e8e$c0e8ca30$0101a8c0@acp42g>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
In-Reply-To: <10307191935.AA16637@clio.rice.edu>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h6K7G1K12877
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> I preprocessed the file, and the problem is that float z; is a 
> declaration, and it's being done AFTER an assignment.  So all 
> the files doing this need to be changed so they are legal C 
> so they will compile.

I spotted the problem after downloading GCC 2.95.3 and trying it.

Below is a patch to fix the problems. I hope I included all the files that I
modified.


*** \djgppcvs\src\libm\math\wf_acos.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_acos.c	Sun Jul 20 16:39:44 2003
***************
*** 31,40 ****
  	return __ieee754_acosf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_acosf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)1.0) {
--- 31,40 ----
  	return __ieee754_acosf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_acosf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)1.0) {
*** \djgppcvs\src\libm\math\wf_acosh.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_acosh.c	Sun Jul 20 16:45:52 2003
***************
*** 32,41 ****
  	return __ieee754_acoshf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_acoshf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<(float)1.0) {
--- 32,41 ----
  	return __ieee754_acoshf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_acoshf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<(float)1.0) {
*** \djgppcvs\src\libm\math\wf_asin.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_asin.c	Sun Jul 20 16:46:02 2003
***************
*** 33,42 ****
  	return __ieee754_asinf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_asinf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)1.0) {
--- 33,42 ----
  	return __ieee754_asinf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_asinf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)1.0) {
*** \djgppcvs\src\libm\math\wf_atan2.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_atan2.c	Sun Jul 20 16:46:08 2003
***************
*** 33,43 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  	uy.f = y;
  
- 	float z;
  	z = __ieee754_atan2f(y,x);
  	if(_LIB_VERSION == _IEEE_||isnanf(ux.l)||isnanf(uy.l)) return z;
  	if(x==(float)0.0&&y==(float)0.0) {
--- 33,43 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+ 	float z;
  	
  	ux.f = x;
  	uy.f = y;
  
  	z = __ieee754_atan2f(y,x);
  	if(_LIB_VERSION == _IEEE_||isnanf(ux.l)||isnanf(uy.l)) return z;
  	if(x==(float)0.0&&y==(float)0.0) {
*** \djgppcvs\src\libm\math\wf_atanh.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_atanh.c	Sun Jul 20 16:46:16 2003
***************
*** 30,39 ****
  	return __ieee754_atanhf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  	
- 	float z,y;
  	z = __ieee754_atanhf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	y = fabsf(x);
--- 30,39 ----
  	return __ieee754_atanhf(x);
  #else
  	_float_long_union ux;
+ 	float z,y;
  	
  	ux.f = x;
  	
  	z = __ieee754_atanhf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	y = fabsf(x);
*** \djgppcvs\src\libm\math\wf_cosh.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_cosh.c	Sun Jul 20 16:46:28 2003
***************
*** 31,40 ****
  	return __ieee754_coshf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_coshf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)8.9415985107e+01) {	
--- 31,40 ----
  	return __ieee754_coshf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_coshf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)8.9415985107e+01) {	
*** \djgppcvs\src\libm\math\wf_fmod.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_fmod.c	Sun Jul 20 16:46:38 2003
***************
*** 32,42 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  	uy.f = y;
  
- 	float z;
  	z = __ieee754_fmodf(x,y);
  	if(_LIB_VERSION == _IEEE_ ||isnanf(uy.f)||isnanf(ux.f)) return z;
  	if(y==(float)0.0) {
--- 32,42 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+ 	float z;
  	
  	ux.f = x;
  	uy.f = y;
  
  	z = __ieee754_fmodf(x,y);
  	if(_LIB_VERSION == _IEEE_ ||isnanf(uy.f)||isnanf(ux.f)) return z;
  	if(y==(float)0.0) {
*** \djgppcvs\src\libm\math\wf_gamma.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_gamma.c	Sun Jul 20 16:46:48 2003
***************
*** 29,38 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  
-         float y;
          y = __ieee754_gammaf_r(x,&signgam);
  		uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
--- 29,38 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+     float y;
  	
  	ux.f = x;
  
          y = __ieee754_gammaf_r(x,&signgam);
  		uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
*** \djgppcvs\src\libm\math\wf_hypot.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_hypot.c	Sun Jul 20 16:46:58 2003
***************
*** 33,43 ****
  	_float_long_union ux;
  	_float_long_union uy;
  	_float_long_union uz;
  	
  	ux.f = x;
  	uy.f = y;
  
- 	float z;
  	z = __ieee754_hypotf(x,y);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
--- 33,43 ----
  	_float_long_union ux;
  	_float_long_union uy;
  	_float_long_union uz;
+ 	float z;
  	
  	ux.f = x;
  	uy.f = y;
  
  	z = __ieee754_hypotf(x,y);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
*** \djgppcvs\src\libm\math\wf_lgamma.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_lgamma.c	Sun Jul 20 16:47:42 2003
***************
*** 29,39 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  
!         float y;
!         y = __ieee754_lgammaf_r(x,&signgam);
  	uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
      if(!finitef(uy.l)&&finitef(ux.l)) {
--- 29,39 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+     float y;
  	
  	ux.f = x;
  
!     y = __ieee754_lgammaf_r(x,&signgam);
  	uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
      if(!finitef(uy.l)&&finitef(ux.l)) {
*** \djgppcvs\src\libm\math\wf_pow.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_pow.c	Sun Jul 20 16:47:50 2003
***************
*** 33,43 ****
  	_float_long_union ux;
  	_float_long_union uy;
  	_float_long_union uz;
  
  	ux.f = x;
  	uy.f = y;
  
- 	float z;
  	z=__ieee754_powf(x,y);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_|| isnanf(uy.l)) return z;
--- 33,43 ----
  	_float_long_union ux;
  	_float_long_union uy;
  	_float_long_union uz;
+ 	float z;
  
  	ux.f = x;
  	uy.f = y;
  
  	z=__ieee754_powf(x,y);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_|| isnanf(uy.l)) return z;
*** \djgppcvs\src\libm\math\wf_remainder.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_remainder.c	Sun Jul 20 16:47:54 2003
***************
*** 31,40 ****
  	return __ieee754_remainderf(x,y);
  #else
  	_float_long_union uy;
  	
  	uy.f = y;
  
- 	float z;
  	z = __ieee754_remainderf(x,y);
  	if(_LIB_VERSION == _IEEE_ || isnanf(uy.l)) return z;
  	if(y==(float)0.0) 
--- 31,40 ----
  	return __ieee754_remainderf(x,y);
  #else
  	_float_long_union uy;
+ 	float z;
  	
  	uy.f = y;
  
  	z = __ieee754_remainderf(x,y);
  	if(_LIB_VERSION == _IEEE_ || isnanf(uy.l)) return z;
  	if(y==(float)0.0) 
*** \djgppcvs\src\libm\math\wf_exp.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_exp.c	Sun Jul 20 16:49:46 2003
*************** u_threshold= -1.0397208405e+02;  /* 0xc2
*** 39,48 ****
  	return __ieee754_expf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_expf(x);
  	if(_LIB_VERSION == _IEEE_) return z;
  	if(finitef(ux.l)) {
--- 39,48 ----
  	return __ieee754_expf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_expf(x);
  	if(_LIB_VERSION == _IEEE_) return z;
  	if(finitef(ux.l)) {
*** \djgppcvs\src\libm\math\wrf_lgamma.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wrf_lgamma.c	Sun Jul 20 16:50:56 2003
***************
*** 32,41 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  	
-         float y;
          y = __ieee754_lgammaf_r(x,signgamp);
  	uy.f = y;
  
--- 32,41 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+     float y;
  	
  	ux.f = x;
  	
          y = __ieee754_lgammaf_r(x,signgamp);
  	uy.f = y;
  
*** \djgppcvs\src\libm\math\wrf_gamma.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wrf_gamma.c	Sun Jul 20 16:51:08 2003
***************
*** 32,41 ****
  #else
  	_float_long_union ux;
  	_float_long_union uy;
  	
  	ux.f = x;
  
-         float y;
          y = __ieee754_gammaf_r(x,signgamp);
  		uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
--- 32,41 ----
  #else
  	_float_long_union ux;
  	_float_long_union uy;
+     float y;
  	
  	ux.f = x;
  
          y = __ieee754_gammaf_r(x,signgamp);
  		uy.f = y;
          if(_LIB_VERSION == _IEEE_) return y;
*** \djgppcvs\src\libm\math\wf_j0.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_j0.c	Sun Jul 20 16:52:26 2003
***************
*** 31,40 ****
  	return __ieee754_j0f(x);
  #else
  	_float_long_union ux;
! 	
  	ux.f = x;
  
! 	float z = __ieee754_j0f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
  		/* j0f(|x|>X_TLOSS) */
--- 31,40 ----
  	return __ieee754_j0f(x);
  #else
  	_float_long_union ux;
! 	float z;
  	ux.f = x;
  
! 	z = __ieee754_j0f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
  		/* j0f(|x|>X_TLOSS) */
***************
*** 55,64 ****
  	return __ieee754_y0f(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_y0f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
--- 55,64 ----
  	return __ieee754_y0f(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_y0f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
*** \djgppcvs\src\libm\math\wf_j1.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_j1.c	Sun Jul 20 16:52:40 2003
***************
*** 32,41 ****
  	return __ieee754_j1f(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_j1f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
--- 32,41 ----
  	return __ieee754_j1f(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_j1f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
***************
*** 57,66 ****
  	return __ieee754_y1f(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_y1f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
--- 57,66 ----
  	return __ieee754_y1f(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_y1f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
*** \djgppcvs\src\libm\math\wf_jn.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_jn.c	Sun Jul 20 16:55:02 2003
***************
*** 28,37 ****
  	return __ieee754_jnf(n,x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_jnf(n,x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
--- 28,37 ----
  	return __ieee754_jnf(n,x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_jnf(n,x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
  	if(fabsf(x)>(float)X_TLOSS) {
***************
*** 53,62 ****
  	return __ieee754_ynf(n,x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_ynf(n,x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
--- 53,62 ----
  	return __ieee754_ynf(n,x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_ynf(n,x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) ) return z;
          if(x <= (float)0.0){
*** \djgppcvs\src\libm\math\wf_log.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_log.c	Sun Jul 20 16:56:16 2003
***************
*** 31,40 ****
  	return __ieee754_logf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_logf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) || x > (float)0.0) return
z;
  	if(x==(float)0.0)
--- 31,40 ----
  	return __ieee754_logf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_logf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l) || x > (float)0.0) return
z;
  	if(x==(float)0.0)
*** \djgppcvs\src\libm\math\wf_log10.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_log10.c	Sun Jul 20 16:56:22 2003
***************
*** 31,40 ****
  	return __ieee754_log10f(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_log10f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<=(float)0.0) {
--- 31,40 ----
  	return __ieee754_log10f(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_log10f(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<=(float)0.0) {
*** \djgppcvs\src\libm\math\wf_scalb.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_scalb.c	Sun Jul 20 16:57:04 2003
***************
*** 44,54 ****
  	_float_long_union ux;
  	_float_long_union uz;
  	_float_long_union ufn;
  
  	ux.f = x;
  	ufn.f = fn;
  
- 	float z;
  	z = __ieee754_scalbf(x,fn);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
--- 44,54 ----
  	_float_long_union ux;
  	_float_long_union uz;
  	_float_long_union ufn;
+ 	float z;
  
  	ux.f = x;
  	ufn.f = fn;
  
  	z = __ieee754_scalbf(x,fn);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
*** \djgppcvs\src\libm\math\wf_sinh.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_sinh.c	Sun Jul 20 16:57:20 2003
***************
*** 32,41 ****
  #else
  	_float_long_union ux;
  	_float_long_union uz;
  
  	ux.f = x;
  
- 	float z; 
  	z = __ieee754_sinhf(x);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
--- 32,41 ----
  #else
  	_float_long_union ux;
  	_float_long_union uz;
+ 	float z; 
  
  	ux.f = x;
  
  	z = __ieee754_sinhf(x);
  	uz.f = z;
  	if(_LIB_VERSION == _IEEE_) return z;
*** \djgppcvs\src\libm\math\wf_sqrt.c	Tue Jul  1 22:48:06 2003
--- e:\dj204\src\libm\math\wf_sqrt.c	Sun Jul 20 16:57:38 2003
***************
*** 31,40 ****
  	return __ieee754_sqrtf(x);
  #else
  	_float_long_union ux;
  	
  	ux.f = x;
  
- 	float z;
  	z = __ieee754_sqrtf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<(float)0.0) {
--- 31,40 ----
  	return __ieee754_sqrtf(x);
  #else
  	_float_long_union ux;
+ 	float z;
  	
  	ux.f = x;
  
  	z = __ieee754_sqrtf(x);
  	if(_LIB_VERSION == _IEEE_ || isnanf(ux.l)) return z;
  	if(x<(float)0.0) {


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019