News for hackers. Stuff that matters.
Re:Declarative memory management (2019) by mananaysiempre on Monday January 03, 2022 @02:33PM (#29785300)
It’s explicitly permissible for every C library function to be implemented as a macro (as well as an identically-named function in case you need the address), but they must preserve the illusion by evaluating every argument exactly once. You were probably thinking of getc(fp), which is special [and different from fgetc(fp)] in that it’s additionally allowed to evaluate fp multiple times: getchar() takes no arguments, so it doesn’t matter either way. Yes, the naming is confusing.

There are no comments on this comment yet.