bug-inetutils
[Top][All Lists]
Advanced

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

cfg.mk: Add checks for 'caddr_t'.


From: Collin Funk
Subject: cfg.mk: Add checks for 'caddr_t'.
Date: Sun, 5 May 2024 19:13:27 -0700
User-agent: Mozilla Thunderbird

There are some uses of 'caddr_t' in Inetutils. This is a prehistoric
BSD type. I think it was because early versions of C didn't
automatically convert 'void *' to the appropriate type.

On GNU/Linux:

    $ grep -Er 'caddr_t;' /usr/include/
    /usr/include/asm-generic/posix_types.h:typedef char *               
__kernel_caddr_t;
    /usr/include/linux/coda.h:typedef void * caddr_t;
    /usr/include/bits/types.h:typedef char *__caddr_t;
    /usr/include/sys/types.h:typedef __caddr_t caddr_t;
    /usr/include/X11/Xw32defs.h:typedef char *caddr_t;
    /usr/include/X11/Xw32defs.h:typedef char *caddr_t;
    /usr/include/tirpc/rpc/types.h:typedef __caddr_t caddr_t;

Patch 0001 adds a syntax check for this type and patch 0002 removes
it's uses since this type is not standardized.

I think it would be nice continue removing old C stuff like this.
Another example is 'index' vs 'strchr' and 'rindex' vs 'strrchr'.
That stuff probably hinders portability more than it helps as the
years go on. :)

Collin

Attachment: 0001-cfg.mk-Add-checks-for-caddr_t.patch
Description: Text Data

Attachment: 0002-Fix-sc_bsd_caddr-checks.patch
Description: Text Data


reply via email to

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