From www@marlena.vvi.at  Fri Feb 25 11:09:39 2005
Return-Path: <www@marlena.vvi.at>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 196F316A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Feb 2005 11:09:39 +0000 (GMT)
Received: from marlena.vvi.at (marlena.vvi.at [208.252.225.59])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 75C7443D31
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Feb 2005 11:09:38 +0000 (GMT)
	(envelope-from www@marlena.vvi.at)
Received: from marlena.vvi.at (localhost.marlena.vvi.at [127.0.0.1])
	by marlena.vvi.at (8.12.10/8.12.9) with ESMTP id j1OFEKoH055918
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Feb 2005 07:14:24 -0800 (PST)
	(envelope-from www@marlena.vvi.at)
Received: (from www@localhost)
	by marlena.vvi.at (8.12.10/8.12.10/Submit) id j1OFEERH055917;
	Thu, 24 Feb 2005 07:14:14 -0800 (PST)
	(envelope-from www)
Message-Id: <200502241514.j1OFEERH055917@marlena.vvi.at>
Date: Thu, 24 Feb 2005 07:14:14 -0800 (PST)
From: "ALeine" <aleine@austrosearch.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Sample Echo Pseudo-Device Driver for FreeBSD 4.X doesn't compile 

>Number:         78062
>Category:       docs
>Synopsis:       Sample Echo Pseudo-Device Driver for FreeBSD 4.X doesn't compile
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 25 11:10:38 GMT 2005
>Closed-Date:    Fri Apr 14 11:15:26 GMT 2006
>Last-Modified:  Fri Apr 14 11:15:26 GMT 2006
>Originator:     ALeine
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
>Environment:


System: FreeBSD 4.11-STABLE #0: Tue Feb 22 18:15:21 CET 2005
    aleine@aleine:/usr/src/sys/compile/ALEINE


>Description:


A `typedef' is missing.



>How-To-Repeat:


# cc -O -pipe -D_KERNEL -Wall -Wredundant-decls -Wnested-externs \
 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline \
 -Wcast-qual -fformat-extensions -ansi -DKLD_MODULE -nostdinc -I- \
 -I. -I@ -I@/../include -mpreferred-stack-boundary=2 -Wall \
 -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
 -fformat-extensions -ansi -c echodev.c

echodev.c:54: syntax error before `*'
echodev.c:54: warning: type defaults to `int' in declaration of `echomsg'
echodev.c:54: warning: data definition has no type or storage class
echodev.c: In function `echo_loader':
echodev.c:78: syntax error before `)'
echodev.c: In function `echo_read':
echodev.c:125: request for member `len' in something not a structure or union
echodev.c:126: request for member `len' in something not a structure or union
echodev.c:126: request for member `len' in something not a structure or union
echodev.c:126: request for member `len' in something not a structure or union
echodev.c:127: request for member `msg' in something not a structure or union
echodev.c:119: warning: `amt' might be used uninitialized in this function
echodev.c: In function `echo_write':
echodev.c:144: request for member `msg' in something not a structure or union
echodev.c:148: request for member `msg' in something not a structure or union
echodev.c:149: request for member `len' in something not a structure or union
echodev.c: At top level:
echodev.c:52: warning: `len' defined but not used
*** Error code 1



>Fix:


--- en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.sgml.old    Thu Feb 24 \
16:25:19 2005
+++ en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.sgml        Thu Feb 24 \
16:27:34 2005
@@ -185,6 +185,8 @@
  * Simple `echo' pseudo-device KLD
  *
  * Murray Stokely
+ *
+ * Corrected by ALeine
  */

 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
@@ -225,7 +227,7 @@
        -1
 };

-struct s_echo {
+typedef struct s_echo {
        char msg[BUFFERSIZE];
        int len;
 } t_echo;



___________________________________________________________________
WebMail FREE http://mail.austrosearch.net 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Apr 14 11:15:05 UTC 2006 
State-Changed-Why:  
Committed.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78062 
>Unformatted:
