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

Re: nonstandard assumptions in the code



At 11:01 AM 5/30/2003, Hallvard B Furuseth wrote:
>I've been getting a bit nervous lately about the number of non-ANSI
>assumptions which the OpenLDAP code makes.  I'd like to at least write a
>test program which configure can run and which tries to warn if one of
>the assumptions do not hold.

That's would be great... though I would hope we also could
reduce our reliance on non-portable assumptions.

>Here are the nonstandard assumptions I have found.

>Do anyone know any others?
>
>* two's complement integers

Certainly.

>* at least 4-byte 'int'

I think we also have code (hash routines) which requires
a 4-byte integer type (but that code is disabled if no such
integer type exists).

>* 8-bit 'char'

Most certainly.

>* ASCII or EBCDIC character set (or a superset of these)
>  (basic assumptions, leave these alone)

The internals assume a standard "C" locale is available.
EBCDIC stuff is on the edges and only enabled if configure
detects the system is EBCDIC based.

>* no padding bits in 'unsigned int'
>  (required by back-bdb/dbcache.c:bdb_db_hash() - don't know why)
>
>* can cast 'int' to 'void *' and back
>  (at least back-shell)

These should be fixed.

>* can cast function pointers to 'void *' and back
>  (at least the threading stuff)

We should be able to clean most of that up.

>* can meaningfully compare pointers to different malloced blocks
>  (slapd/sl_malloc.c)

See Howard's comment here.

>* 'long long' support
>  (liblutil/uuid.c - can write #ifndef HAVE_LONG_LONG variant to fix it)

Seems reasonable.

>* accepts string literals longer than 509 characters
>  (easy to fix)

okay.


>* other limits, like lower max num of #defines
>  (leave these alone)

okay.

>One other question - how do I test whether the ldap installation will
>support EBCDIC?  I know EBCDIC support has been added, or at least is
>partly added, but I don't know how to test for it in configure.

see build/openldap.m4's OL_CPP_EBCDIC.

Kurt