From 6d8d7a88b273fc8d9e99d2ddc372d769d767d353 Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Mon, 25 Oct 2010 18:03:36 +0100 Subject: [PATCH] libc!setmode.c: Avoid #if inside macro call #if inside macro call is undefined behaviour under the C standard (3.8.3 paragraph 10 for C90, 6.8.10 paragraph 11 for C99). The same effect can be achieved with a slightly more verbose construct, putting the whole macro call inside the #ifdef/#else/#endif. --- lib/libc/other/setmode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/other/setmode.c b/lib/libc/other/setmode.c index 3eb154cbf..1c4c4bffd 100644 --- a/lib/libc/other/setmode.c +++ b/lib/libc/other/setmode.c @@ -236,11 +236,11 @@ setmode(p) goto out; } perm = (mode_t)lval; - ADDCMD('=', (STANDARD_BITS #ifdef S_ISTXT - |S_ISTXT + ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask); +#else + ADDCMD('=', (STANDARD_BITS), perm, mask); #endif - ), perm, mask); set->cmd = 0; return (saveset); } -- 2.44.0