3 ms·
For those who don't know, hygienic macros are ones that avoid variable name collision. An example below from https://www.geeksforgeeks.org/hygienic-macros-intro
by jimbob45 7y ago
For those who don't know, hygienic macros are ones that avoid variable name collision. An example below from https://www.geeksforgeeks.org/hygienic-macros-introduction/ https://www.geeksforgeeks.org/hygienic-macros-introduction/
// C program to illustrate a situation known as
// accidental capture of identifiers - an
// undesirable result caused by unhygienic macros
#define INCI(i) do { int x = 0; ++i; } while(0)
int main(void)
{
int x = 4, y = 8;
// macro called first time
INCI(x);
// macro called second time
INCI(y);
printf("x = %d, b = %d\n", x, y);
return 0;
}