bug-inetutils
[Top][All Lists]
Advanced

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

Re: cfg.mk: Add checks for 'caddr_t'.


From: Simon Josefsson
Subject: Re: cfg.mk: Add checks for 'caddr_t'.
Date: Mon, 06 May 2024 14:26:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Collin Funk <collin.funk1@gmail.com> writes:

> 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.
...
> Patch 0001 adds a syntax check for this type and patch 0002 removes
> it's uses since this type is not standardized.

Looks good to me, feel free to push.

> 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. :)

I do mostly agree, however there is another concern: frivolious changes
like this makes it harder to align code with BSD implementations for
auditing and security backports.  I've sporadically coordinated some
security fixes with tnftp which seems to be the maintained BSD ftp
implementation.  I've noticed they have a bunch of fixes that went into
that code over the years that we don't have.  Of course, they likely
won't add any of our improvements, but I don't think there is a lot of
arguments why we shouldn't continue to import good patches from BSD ftp
to GNU ftp.  I have a mental todo to attempt to do a BSD-to-GNU diff on
some of these tools, and backport all reasonable improvements they have.

For this particular example, they replaced a (caddr_t*) cast to (char*)
which I think is just wrong (the type is sockaddr_in and not char*).  So
your patch is better.

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

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