[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: 64bit issue in libraries/liblunicode/ucdata/ucdata.c causes slapd to dump core (ITS#1960)



I've also been seeing a number of size mismatch errors when building 
with MSVC++.

I can't remember my exact env., but I could not get uint32_t and others 
on solaris( could have just been my environment ).  As you said there 
maybe other environments were this is the case as well.  In these 
environments, specify our own to afford name clashes.

I think it might be a good idea to wrap all the types and use configure 
and/or portable.h to define them at build time base on the arch at build 
time.

eg.
#define LDAP_UINT8 unsigned char
etc. and use those.

--Kervin


rhafer@suse.de wrote:
> Full_Name: Ralf Haferkamp
> Version: HEAD
> OS: LInux on IA64
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (213.95.15.201)
> 
> 
> At the top of the file the following struct is defined:
> 
> typedef struct {
>     unsigned short bom;
>     unsigned short cnt;
>     union {
>         unsigned long bytes;
>         unsigned short len[2];
>     } size;
> } _ucheader_t;
> 
> The type "long" is however 8 bytes long on (most) 64Bit Archs. So the union
> "size" make some trouble, when you access it through the len[] array.
> 
> One workaround could be to change the "long" to "uint32_t" which is available on
> Linux but I am not sure how portable this is. Is there a "uint32_t" on BSD?
> 
> If I make this change slapd seems to work flawlessly. All test cases succeed.
> 
> 
>