Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Feb 2003 22:48:07 +0100 (CET)
From:      Stefan Farfeleder <stefan@fafoe.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        stefan@fafoe.dyndns.org
Subject:   bin/48793: [patch] small fix for apmd(8)
Message-ID:  <20030228214807.3A490848@frog.fafoe>

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

>Number:         48793
>Category:       bin
>Synopsis:       [patch] small fix for apmd(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 28 13:50:10 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Farfeleder
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD frog.fafoe 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Fri Feb 28 12:02:34 CET 2003 freebsd@frog.fafoe:/freebsd/frog/obj/freebsd/frog/src/sys/FROG i386


	
>Description:
The BATTTIME and BATTPERCENT tokens of apmdparse.y use the int member
'i' of the yylval union, not 'str'.  An integer is assigned to yylval.i
in apmdlex.l and non-terminal apm_battery_level has type int too.
	
>How-To-Repeat:
buildworld produces these warnings:

	===> usr.sbin/apmd
	cc -O -pipe -mcpu=pentiumpro -I. -I/freebsd/frog/src/usr.sbin/apmd    -c /freebsd/frog/src/usr.sbin/apmd/apmd.c
	gzip -cn /freebsd/frog/src/usr.sbin/apmd/apmd.8 > apmd.8.gz
	cc -O -pipe -mcpu=pentiumpro -I. -I/freebsd/frog/src/usr.sbin/apmd    -c apmdparse.c
	cc -O -pipe -mcpu=pentiumpro -I. -I/freebsd/frog/src/usr.sbin/apmd    -c apmdlex.c
	/freebsd/frog/src/usr.sbin/apmd/apmdparse.y: In function `yyparse':
	/freebsd/frog/src/usr.sbin/apmd/apmdparse.y:101: warning: assignment makes integer from pointer without a cast
	/freebsd/frog/src/usr.sbin/apmd/apmdparse.y:105: warning: assignment makes integer from pointer without a cast
	cc -O -pipe -mcpu=pentiumpro -I. -I/freebsd/frog/src/usr.sbin/apmd     -o apmd apmd.o apmdlex.o apmdparse.o -ll
	
>Fix:

	

--- apmd.diff begins here ---
Index: src/usr.sbin/apmd/apmdparse.y
===================================================================
RCS file: /usr/home/ncvs/src/usr.sbin/apmd/apmdparse.y,v
retrieving revision 1.3
diff -u -r1.3 apmdparse.y
--- src/usr.sbin/apmd/apmdparse.y	15 May 2001 05:13:45 -0000	1.3
+++ src/usr.sbin/apmd/apmdparse.y	28 Feb 2003 01:53:46 -0000
@@ -56,7 +56,7 @@
 %token APMEVENT
 %token APMBATT
 %token BATTCHARGE BATTDISCHARGE
-%token <str> BATTTIME BATTPERCENT
+%token <i> BATTTIME BATTPERCENT
 %token EXECCMD REJECTCMD
 %token <ev> EVENT
 %token <str> STRING UNKNOWN
--- apmd.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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