bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNULIB readline module


From: Mark D. Baushke
Subject: GNULIB readline module
Date: Fri, 05 Nov 2004 10:53:04 -0800

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings,

The purpose of the GNULIB readline module seems to be to provide a stub
primarily for Windows platofrms.

The odd thing is that it does not compile on those platforms unless
the config.h file has a '#define size_t unsigned' in it because it
assumes that the size_t type is found in the <sys/types.h> file.

Under windows, this is apparently not a good assumption.

Looking in POSIX, it seems that <stddef.h> is the place where size_t
should be defined. I see no mention that <sys/types.h> is needed.

I am curious to know if would be reasonable to add a #include <stddef.h>
to the lib/readline.c file?

I suspect that whoever is looking for size_t may wish to consider
looking in more than one place as we move forward, but I am not even
sure where that topic should be raised...

        Thanks,
        -- Mark

"Conrad T. Pino" <Conrad@Pino.com> writes:

>> From: Mark D. Baushke
>> 
>> > The compile error occurs because none of the "#include" files cited
>> > contain a "typedef" declaration for the "size_t" identifier.
>> 
>> Hmmm... so, in which #include file do you see size_t ?
>
>VC6 provide "size_t" declarations in these files:
>
>       File Include\CRTDBG.H:
>       38      typedef unsigned int size_t;
>
>       File Include\DIRECT.H:
>       75      typedef unsigned int size_t;
>
>       File Include\MALLOC.H:
>       69      typedef unsigned int size_t;
>
>       File Include\MBSTRING.H:
>       68      typedef unsigned int size_t;
>
>       File Include\MEMORY.H:
>       62      typedef unsigned int size_t;
>
>       File Include\NATIVE.H:
>       45      typedef unsigned int size_t;
>
>       File Include\NEW.H:
>       64      typedef unsigned int size_t;
>
>       File Include\RPCNDR.H:
>       194     typedef unsigned int size_t;
>
>       File Include\SEARCH.H:
>       62      typedef unsigned int size_t;
>
>       File Include\STDDEF.H:
>       93      typedef unsigned int size_t;
>
>       File Include\STDEXCPT.H:
>       42      typedef unsigned int size_t;
>
>       File Include\STDIO.H:
>       70      typedef unsigned int size_t;
>
>       File Include\STDLIB.H:
>       71      typedef unsigned int size_t;
>
>       File Include\STRING.H:
>       61      typedef unsigned int size_t;
>
>       File Include\TIME.H:
>       89      typedef unsigned int size_t;
>       172     typedef unsigned int size_t;
>
>       File Include\WCHAR.H:
>       79      typedef unsigned int size_t;
>
>>    <string.h>    /* historical location */
>
>Yes, "size_t" declared.
>
>>    <stdio.h>     /* historical location */
>
>Yes, "size_t" declared.
>
>>    <stddef.h>    /* C89 defined location */
>
>Yes, "size_t" declared.
>
>>    <sys/types.h> /* GNULIB seems to think it should be here */
>
>No, "size_t" NOT declared.
>
>> Looking more closely at the system, the windows-NT/config.h.in.in,
>> windows-NT/config.h.in and windows-NT/config.h files should all do
>> 
>> /* Define to `unsigned' if <sys/types.h> does not define. */
>> #define size_t unsigned
>> 
>> in order to 'fix' things... However, that will probably actually break
>> the build until readlink() is removed from widows-NT/filesubr.c too...
>
>I prefer avoiding "#define" if "#include" with correct "typedef" is
>available and alternative solutions will also break the build.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFBi8wQ3x41pRYZE/gRAqNpAJ487VIfFNMgx811yEH5gqW3FNSG8gCgx0wp
xTgqenR7dipGVu8i0/BAa0Y=
=Idxm
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]