This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

64 bit problem?


hi,

i do have to cases

first one:
while porting a linux project to the amd 64 bit platform
on a gentoo linux based os, i ran into some trouble.

/usr/src/linux/include/asm/types.h:22: error: conflicting declaration 'typedef long long int int64_t'
/usr/include/gentoo-multilib/amd64/sys/types.h:199: error: 'int64_t' has a previous declaration as 'typedef long int int64_t'
/usr/src/linux/include/asm/types.h:23: error: conflicting declaration 'typedef long long unsigned int u_int64_t'
/usr/include/gentoo-multilib/amd64/sys/types.h:209: error: 'u_int64_t' has a previous declaration as 'typedef long unsigned int u_int64_t'

this is happening everytime, when i include e.h. linux/dvb/dmx.h header that
itself includes <asm/types.h>

reordering include entries in some places - so kernel includes are done before any other - does work.


second case:

while debugging case a i found a missing #ifdef clause in sys/types.h also.

this following section is copy&paste out of libc cvs posix/sys/types.h

# ifndef __int8_t_defined
#  define __int8_t_defined
__intN_t (8, __QI__);
__intN_t (16, __HI__);
__intN_t (32, __SI__);
__intN_t (64, __DI__);
# endif

__u_intN_t (8, __QI__);
__u_intN_t (16, __HI__);
__u_intN_t (32, __SI__);
__u_intN_t (64, __DI__);


it does a check for signed int types if maybe a redefinition would happen. it does no check for 
the unsigned ones.

following would be the correct implementation imho. 

# ifndef __int8_t_defined
#  define __int8_t_defined
__intN_t (8, __QI__);
__intN_t (16, __HI__);
__intN_t (32, __SI__);
__intN_t (64, __DI__);
# endif

# ifndef __u_int8_t_defined
#  define __u_int8_t_defined
__u_intN_t (8, __QI__);
__u_intN_t (16, __HI__);
__u_intN_t (32, __SI__);
__u_intN_t (64, __DI__);
# endif


any hints on case a or b? 

if b is correct, should i provide a patch against cvs?

best regards 
marcel


Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]