docs/78062: Sample Echo Pseudo-Device Driver for FreeBSD 4.X doesn't compile

ALeine aleine at austrosearch.net
Fri Feb 25 11:10:39 UTC 2005


>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 25 11:10:38 GMT 2005
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-doc mailing list