I was browsing some code and I came across this macro definition
#define D(x) do { } while (0)
And its used in the code like this,
D(("couldn't identify user %s", user));
I ran the code, and that particular line doesn’t do anything. So, why would some one define a macro like that?
In case you’re wondering, that macro is defined in the _pam_macros.h header file.
Most likely
Dis for debugging, and there’s an#ifdefelsewhere that makes it do something more useful if debugging is enabled, like output the message or log it to a file. Thedo/whileloop is to make it require a semi-colon at the end, so the user can call it asD(...);instead of justD(...)(see this post)