Bug 61894 - Redefinition of uint8_t et cetera
Summary: Redefinition of uint8_t et cetera
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-25 18:47 UTC by Bill McCarty
Modified: 2016-11-24 15:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-03-25 19:36:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill McCarty 2002-03-25 18:47:41 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; Q312461)

Description of problem:
Both /usr/include/sys/types.h and /usr/include/stdint.h unconditionally define 
uint8_t and uint16_t. The former also unconditionally defines uint32_t. This 
causes type redefinition errors when compiling code that uses both include 
files. This affects, for instance, Snort 1.8.4. 

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Download and attempt to compile snort-1.8.4, available at www.snort.org.
	

Actual Results:  
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/pcap  -I/usr/include  -g -O2 -
Wall -DDEBUG -ggdb -DENABLE_RESPONSE -D_BSD_SOURCE -D__BSD_SOURCE -
D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -DLIBNET_LIL_ENDIAN -c snort.c
In file included from /usr/include/netinet/in.h:23,
                 from snort.h:43,
                 from snort.c:45:
/usr/include/stdint.h:49: redefinition of `uint8_t'
/usr/include/sys/types.h:196: `uint8_t' previously declared here
/usr/include/stdint.h:50: redefinition of `uint16_t'
/usr/include/sys/types.h:197: `uint16_t' previously declared here
/usr/include/stdint.h:52: redefinition of `uint32_t'
/usr/include/sys/types.h:198: `uint32_t' previously declared here
make[2]: *** [snort.o] Error 1
make[2]: Leaving directory `/root/snort-1.8.4'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/snort-1.8.4'
make: *** [all-recursive-am] Error 2


Expected Results:  Clean compile.

Additional info:

These include files are included in glibc-devel-2.2.4-19.3, but I don't find 
the glibc-devel component listed. So, I filed under glibc.

Comment 1 Jakub Jelinek 2002-03-25 19:36:48 UTC
No, <stdint.h> unconditionally defines uint8_t, uint16_t etc., while
<sys/types.h> unconditionally defines u_int8_t, u_int16_t etc.
The only way how this could happen is if snort defined u_int8_t to uint8_t
before including the headers.

Comment 2 Bill McCarty 2002-03-25 20:05:47 UTC
Yes, you're exactly right. Thanks for the keen eyes and mind and the timely 
reply. I'll report this issue to the developers.


Note You need to log in before you can comment on or make changes to this bug.