ports/69195: [PATCH] misc/wmweather+ causes FP exception (divide by zero) on -CURRENT boxes

Yi-Hsuan Hsin (Michael Hsin) mhsin at mhsin.org
Sat Jul 17 15:30:19 UTC 2004


>Number:         69195
>Category:       ports
>Synopsis:       [PATCH] misc/wmweather+ causes FP exception (divide by zero) on -CURRENT boxes
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 17 15:30:18 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Yi-Hsuan Hsin (Michael Hsin) <mhsin at mhsin.org>
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD Eliza.mhsin.org 5.2-CURRENT FreeBSD 5.2-CURRENT #12: Sat Jul 17 00:36:58 CST 2004 root at Eliza.mhsin.org:/usr/obj/usr/src/sys/Eliza i386


	
>Description:
	In files/patch-convert.h, defined NAN as 0/0, which will cause FP exception (divide by zero) on -CURRENT boxes (but works fine on some -STABLEs, I don't know why).
	To define NAN as 0.0/0 is ok, but I think system definition of NAN (in math.h) will be better.

>How-To-Repeat:
	Build and install misc/wmweather+, run it (on -CURRENT boxes).

>Fix:

	Include math.h in convert.h, and do not define NAN as 0/0.


--- patch-convert.h.orig	Sat Apr 12 04:37:09 2003
+++ patch-convert.h	Sat Jul 17 23:24:58 2004
@@ -1,11 +1,8 @@
 --- convert.h.orig	Fri Sep  6 04:04:06 2002
 +++ convert.h	Fri Apr 11 02:07:44 2003
-@@ -12,6 +12,8 @@
-  *   x<0 is used for rh, pressure, and windspeed
-  */
- 
-+#define NAN 0/0
+@@ -1,3 +1,5 @@
++#include <math.h>
 +
- /* Calculations */
- int rh_C(int temp_C, int dewpt_C);
- int rh_F(int temp_F, int dewpt_F);
+ #ifndef PI
+ # define PI 3.1415926535897932384626433832795029L
+ #endif
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list