🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ralf Fassel Fri, 11 Sep 1992 22:20
#include-file-bug?
#1130
Author: Ralf Fassel
Date: Fri, 11 Sep 1992 22:20
70 lines
3039 bytes
Guten Tag,
trying to compile source code containing sth like:
/***************************/
/*  test.c */
#include	<sys/ioctl.h>
#define	S32DSINT  (_IO(D,4))
main()
{
	int i=S32DSINT;
}
/***************************/
results in:
> 
> make -k CC=gcc CFLAGS="-g -O -traditional" CPPFLAGS= test.o
> gcc -g -O -traditional -target sun4 -c  test.c
> test.c: In function `main':
> test.c:6: `D' undeclared (first use this function)
> test.c:6: (Each undeclared identifier is reported only once
> test.c:6: for each function it appears in.)
> *** Error code 1
> 
GCC configuration is:
gcc -v:
-Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1.2/2.2.2/specs
-gcc version 2.2.2

running on
sun sparc ipx sunos 4.1.2

was configured:
configure --target=sparc-sun-sunos4.1.2

it seems to me that the error is located in ioccom.h in <sys/>

compare:
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.2/2.2.2/include/sys/ioccom.h:
/* the 0x20000000 is so we can distinguish new ioctl's from old */
#define	_IO(x,y)	(_IOC_VOID|(x<<8)|y)
#define	_IOR(x,y,t)	(_IOC_OUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
#define	_IORN(x,y,t)	(_IOC_OUT|(((t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
#define	_IOW(x,y,t)	(_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
#define	_IOWN(x,y,t)	(_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
/* this should be _IORW, but stdio got there first */
#define	_IOWR(x,y,t)	(_IOC_INOUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
#define	_IOWRN(x,y,t)	(_IOC_INOUT|(((t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
-----------------------------------
with:
/usr/include/sys/ioccom.h
/* the 0x20000000 is so we can distinguish new ioctl's from old */
#define	_IO(x,y)	(_IOC_VOID|('x'<<8)|y)
#define	_IOR(x,y,t)	(_IOC_OUT|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define	_IORN(x,y,t)	(_IOC_OUT|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define	_IOW(x,y,t)	(_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define	_IOWN(x,y,t)	(_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
/* this should be _IORW, but stdio got there first */
#define	_IOWR(x,y,t)	(_IOC_INOUT|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define	_IOWRN(x,y,t)	(_IOC_INOUT|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
-----------------------------------
and not the quotes '' around the x'es.

Is this a bug or what did I wrong installing GCC?

Best regards
Ralf

---------------------------------------------------------
Ralf Fassel                   III.Physikalisches Institut
Internet: ralf@up3aud1.gwdg.de          Buergerstr. 42-44
Phone: (Germany)(551)39-7730            W-3400 Goettingen
FAX:   (Germany)(551)39-7720                      Germany
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads