🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1130

#include-file-bug?

#1130
From: 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
Technical Details
Message-ID: <9209111820.AA11014@up3aud1.gwdg.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!up3aud1.gwdg.de!ralf

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!up3aud1.gwdg.de!ralf
From: ralf@up3aud1.gwdg.de (Ralf Fassel)
Subject: #include-file-bug?
Message-ID: <9209111820.AA11014@up3aud1.gwdg.de>
Sender: gnulists@ai.mit.edu
Organization: Gnus Not Usenet
Distribution: gnu
Date: Fri, 11 Sep 1992 22:20:47 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 71