On 2023-07-11 15:28, Mouse wrote:
I don't get it.  Why the "void *" stuff?  That is where I think the
real badness lies, and I agree we should not have that.

But defining something like

typedef struct bus_dma_tag *bus_dma_tag_t;

would mean we could easily change what bus_dma_tag_t actually is,
keeping it opaque, while at the same time keeping the type checking.

Um, no, you get the type checking only as long as "what [it] actually
is" is a tagged type - a struct, union, or (I think; I'd have to check)
enum.  Make it (for example) a char *, or an unsigned int, and you lose
much of the typechecking.

Maybe I missed your point. Yes, if you typedef something based on some simple type like int, that it's no different than any other int.

typedefs in C don't really create new types. They are all just derivatives. Sometimes I even wonder why typedef exists in C. Feels like I could accomplish the same with a #define

  Johnny

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

Reply via email to