On Mon, Jul 04, 2022 at 07:57:57PM -0300, Martin Fernandez wrote: > + **ARG_REUSE** > + Using the same argument multiple times in the macro definition > + would lead to unwanted side-effects. > + > + For example, given a `min` macro defined like:: > + > + #define min(x, y) ((x) < (y) ? (x) : (y)) > + > + If you call it with `min(foo(x), 0)`, it would expand to:: > + > + foo(x) < 0 ? foo(x) : 0 > + Nit: literal blocks are indented three spaces relative to surrounding paragraph. > + If `foo` has side-effects or it's an expensive calculation the > + results might not be what the user intended. > + > + For a workaround the idea is to define local variables to hold the > + macro's arguments. Checkout the actual implementation of `min` in > + include/linux/minmax.h for the full implementation of the > + workaround. > + For inline code, the correct syntax is ``some text``. However, by convention here, the backquotes aren't used where these would be appropriate, like variable and function names. For the last paragraph, better say "The workaround is to define local variables to hold macro arguments. See the min macro in include/linux/minmax.h for example.". -- An old man doll... just what I always wanted! - Clara