News for hackers. Stuff that matters.
Re:My personal C coding style as of late 2023 by kibibu on Sunday October 08, 2023 @11:08PM (#37816534)
Should perhaps be

    int Foo_bar(const Foo * self);
Re:My personal C coding style as of late 2023 by glitchc on Sunday October 08, 2023 @11:24PM (#37816615)
Even then, some other function can change the memory at the address of self while this one is executing, especially in concurrent systems. Additionally, any other pointer pointing to the same address can also modify self's memory. const in this case is really just "scout's honour".
Re:My personal C coding style as of late 2023 by jenadine on Monday October 09, 2023 @01:14AM (#37817101)
`const Foo*` and `Foo const*` are exactly the same and just a question of style (east-const vs. west-const)

Not to be confused with `Foo *const`

Re:My personal C coding style as of late 2023 by PennRobotics on Monday October 09, 2023 @03:39AM (#37817974)
For anyone thinking, "wtf const pointer order??" fall back on the spiral rule:

https://c-faq.com/decl/spiral.anderson.html