News for hackers. Stuff that matters.
Re:C will never stop you from making mistakes by virtue3 on Monday August 10, 2020 @12:21PM (#24110916)
The problem is macro expansion is not (potentially) what you think it is:

MULTIPLY(2+3,4+5) that expands in

2+34+5 (and not into: (2+3)(4+5)).

To have the latter, you should define:

#define MULTIPLY(a,b) ((a)*(b))

https://stackoverflow.com/questions/14041453/why-are-preproc....

Re:C will never stop you from making mistakes by favorited on Monday August 10, 2020 @03:02PM (#24112795)
But it's so nice and composable! /s

    #define DEREFERENCE(b) MULTIPLY(=, b)

    int thing DEREFERENCE(ptr);
Re:C will never stop you from making mistakes by virtue3 on Monday August 10, 2020 @07:46PM (#24115582)
You sir, are a true monster. I salute you.