Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jul 2004 23:27:42 +0800 (CST)
From:      Yi-Hsuan Hsin (Michael Hsin) <mhsin@mhsin.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        harald.wille@students.jku.at
Subject:   ports/69195: [PATCH] misc/wmweather+ causes FP exception (divide by zero) on -CURRENT boxes
Message-ID:  <20040717152742.01372FFD2@Ada.mhsin.org>
Resent-Message-ID: <200407171530.i6HFUIEp055769@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040717152742.01372FFD2>