[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202402050459.892907C59C@keescook>
Date: Mon, 5 Feb 2024 05:01:49 -0800
From: Kees Cook <keescook@...omium.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Andy Shevchenko <andy@...nel.org>,
Justin Stitt <justinstitt@...gle.com>,
linux-hardening@...r.kernel.org,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>,
Jason Wang <jasowang@...hat.com>, kernel test robot <lkp@...el.com>,
Nathan Chancellor <nathan@...nel.org>,
Azeem Shaikh <azeemshaikh38@...il.com>,
linux-kernel@...r.kernel.org, linux-um@...ts.infradead.org
Subject: Re: [PATCH v2 2/4] string: Allow 2-argument strscpy()
On Mon, Feb 05, 2024 at 01:47:08PM +0100, Geert Uytterhoeven wrote:
> > +/*
> > + * The 2 argument style can only be used when dst is an array with a
> > + * known size.
> > + */
> > +#define __strscpy0(dst, src, ...) \
> > + sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst))
> > +#define __strscpy1(dst, src, size) sized_strscpy(dst, src, size)
>
> (dst), (src), (size) etc.
I normally don't do this when macro args are being expanded into
function arguments. I've only done it for when macro args are used in
expressions. Am I missing a side-effect here, or is this more about
stylistic consistency?
--
Kees Cook
Powered by blists - more mailing lists