Re: [RFC PATCH] pre-process: add __VA_OPT__ support

Al Viro <[email protected]> Wed, 1 Apr 2026 21:22:30 +0100
Newsgroups org.kernel.vger.linux-sparse
Message-ID <20260401202230.GB2063236@ZenIV>
On Wed, Apr 01, 2026 at 08:52:52PM +0100, Al Viro wrote:

> Something like delta below ought to take care of __builtin_strcmp(); figuring
> out the things like "ab"[1] being equal to 'b' is something I'd rather
> leave for later - at the very least after I resurrect and repost the
> busy-wait in shrink_dcache_parent() patchset.  I've really spent way
> too much of the last couple of months on digging in sparse ;-/

BTW, gcc doesn't accept a trick allowed by clang (as well as by sparse with
this patch):

#define splat() ({	\
	_Static_assert(__builtin_strcmp(__func__, "foo") == 0, \
		       "use only in foo()");	\
	something();	\
})

gcc does not realize that __func__ is a constant array with known contents.
Oh, well...