tech-kern archive

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

Re: [PATCH] style(5): No struct typedefs





On 2023-07-14 00:22, Taylor R Campbell wrote:
Date: Tue, 11 Jul 2023 19:50:19 -0700
From: Jason Thorpe <thorpej%me.com@localhost>

On Jul 11, 2023, at 2:56 PM, Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:

I agree the keyword is ugly, and it's unfortunate that in order to
omit it we would have to use C++, but the ugliness gives us practical
benefits of better type-checking, reduced header file maintenance
burden, and reduced motivation for unnecessary header file
dependencies.

No -- you just don't have to use "void *".  Can you point to a
practical problematic example?

Using `struct bus_dma_tag *' instead of `void *' (whether via the
bus_dma_tag_t alias or not) would provide better type-checking.

Using "typedef struct bus_dma_tag *" instead of "typedef void *" will do the same thing. That is no reason at all why to skip the typedef.

And I totally agree that void * is usually something to be avoided, if possible. But I still fail to see what it has to do with the topic on typedef or not.

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index