Re:The C Programming Language: Myths and Reality (1)
by gjulianm on Monday July 17, 2023 @03:21PM
(#36762724)
Out of curiosity, how would you do it? The ways I've seen require using another "public" struct and either casting public to private or using a nested pointer, each with their set of problems. In either case, it's still a bit hacky and still each struct is all-or-nothing public or private.
Re:The C Programming Language: Myths and Reality (1)
by lelanthran on Monday July 17, 2023 @04:10PM
(#36763371)
Pretty much. All the casting and hackiness isn't visible to the caller, and the implementation still maintains its ABI when the private stuff changes.
You can, in a defined way (i.e., no invoking of UB). I just didn't put that in.