Re:Relive: 50 years of C, the good, the bad and the ugly
by asveikau on Friday December 30, 2022 @06:10PM
(#34191221)
> C completely lacks such facility.
Generic linked lists can be done with pointer casts. See the way the Linux kernel does it.
The list manipulation routine takes a pointer to a member, and the more specific type is opaque. The code that knows what the actual structure is can derive it from a node pointer.
A structure can even have multiple node pointers in this scheme.
Re:Relive: 50 years of C, the good, the bad and the ugly
by kazinator on Saturday December 31, 2022 @03:36AM
(#34194714)
* * *
Re:Relive: 50 years of C, the good, the bad and the ugly
by imran0 on Saturday December 31, 2022 @08:11AM
(#34196130)
> Sounds familiar.
I cannot decide whether it's an honor or an insult to be called a _fascist sympathizer_ for opposing the authoritarian suppression of speech.
Re:Relive: 50 years of C, the good, the bad and the ugly
by asveikau on Saturday December 31, 2022 @11:44AM
(#34198134)
I didn't want to address this because it's a tangent, but I understand that free speech protects expressing fascist thought. I can still disapprove of it and not want to be around a lot of it, consider high concentrations of it to be a sign of an unhealthy community, without saying it should be somehow illegal.
To be fair, the most straightforward definition of the linked list is generic, and C completely lacks such facility.
> fascist-
Sounds familiar.
https://news.ycombinator.com/item?id=33478321