From owner-freebsd-bugs Sat Jun 24 5:20: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 2788B37BBF6 for ; Sat, 24 Jun 2000 05:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA71252; Sat, 24 Jun 2000 05:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 03E0F37B6B1; Sat, 24 Jun 2000 05:13:39 -0700 (PDT) Message-Id: <20000624121339.03E0F37B6B1@hub.freebsd.org> Date: Sat, 24 Jun 2000 05:13:39 -0700 (PDT) From: mhenry@speednet.com.au To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/19485: Syscall module example fails to compile Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19485 >Category: kern >Synopsis: Syscall module example fails to compile >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 24 05:20:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Michael Henry >Release: FreeBSD 4.0-STABLE i386 >Organization: >Environment: FreeBSD playground.foonet 4.0-STABLE FreeBSD 4.0-STABLE #0: Thu Jun 15 20:54:58 EST 2000 root@playground.foonet:/usr/obj/usr/src/sys/PLAYGROUND i386 >Description: I'm getting errors when trying to compile the example system call in /usr/share/examples/kld/syscall/module/syscall.c. The version of the file is 1.2. The errors are as follows: *** In file included from syscall.c:35: *** /usr/include/sys/systm.h:327: syntax error before `int' *** /usr/include/sys/systm.h:328: syntax error before `int' *** /usr/include/sys/systm.h:329: syntax error before `(' The corresponding lines from the header are: *** int major(dev_t x); *** int minor(dev_t x); *** dev_t makedev(int x, int y); There is a comment above these lines: "Common `dev_t' stuff are declared here to avoid #include poisoning". But these lines are getting mangled by the following macros defined in : *** #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ *** #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ *** #define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ which, after pre-processing, results in the following: *** int ((int)(((u_int)( dev_t x ) >> 8)&0xff)) ; *** int ((int)(( dev_t x )&0xffff00ff)) ; *** dev_t ((dev_t)((( int x ) << 8) | ( int y ))) ; Clearly this is nonsense. >How-To-Repeat: cd /usr/share/examples/kld/syscall/module/ gcc -c syscall.c >Fix: Remove offending lines from >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message