X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Documentation%2FCodingStyle;fp=Documentation%2FCodingStyle;h=f4b78eafd92a2e76e439f168fff97e1d41374b59;hb=d6a24d0640d609138a4e40a4ce9fd9fe7859e24c;hp=e55accfca276182170fddc67d929e7f5500a18cd;hpb=197175427a221fe3200f7727ea35e261727e7228;p=pandora-kernel.git diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index e55accfca276..f4b78eafd92a 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle @@ -662,6 +662,19 @@ macros using parameters. #define CONSTANT 0x4000 #define CONSTEXP (CONSTANT | 3) +5) namespace collisions when defining local variables in macros resembling +functions: + +#define FOO(x) \ +({ \ + typeof(x) ret; \ + ret = calc_ret(x); \ + (ret); \ +)} + +ret is a common name for a local variable - __foo_ret is less likely +to collide with an existing variable. + The cpp manual deals with macros exhaustively. The gcc internals manual also covers RTL which is used frequently with assembly language in the kernel.