getdomainname prototype definition in admin/acinclude.m4.in

Thiago Macieira thiagom at wanadoo.fr
Thu Jul 17 17:26:54 BST 2003


Hello,

revision 2.371 of admin/acinclude.m4.in changed the definition of the 
getdomainname prototype:
-               [int getdomainname (char *, int)],
+               [int getdomainname (char *, size_t)],

I've done some searching on the Internet and it seems to me that only Linux 
uses size_t (which is unsigned) as the second parameter. Every other system I 
found seemed to use int (Google searches for FreeBSD, OpenBSD, Solaris, HP-UX 
and AIX).

While there isn't much of a problem considering this is a C function, the 
problem arises when #include <config.h> is the first include in a file -- 
which is the recommended behaviour according to autoconf. When that happens, 
the compiler chokes due to the fact that size_t is an undefined type: neither 
stddef.h nor sys/types.h has been included yet.

So, as far as I can see, there are two solutions:
1) revert the prototype back to int
2) #include <stddef.h> inside config.h

Any thoughts?

BTW, the historic for the prototype is very bizarre. It started with 'int' in 
2.271, got changed to 'unsigned int' in 2.283, then back to 'int' in 2.334 
(log says "AIX fixes") and now it's 'size_t'.
-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiagom at mail.com           
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030717/73f0a7bf/attachment.sig>


More information about the kde-core-devel mailing list