Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Alexey Gladkov <gladkov.alexey@gmail.com>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Add symantic index utility
Date: Wed, 11 Mar 2020 18:11:57 +0100	[thread overview]
Message-ID: <20200311171157.fhpuwphwfn3ek7wm@ltop.local> (raw)
In-Reply-To: <20200311113351.GA19327@redhat.com>

On Wed, Mar 11, 2020 at 12:33:52PM +0100, Oleg Nesterov wrote:
> and just in case... there are other cases when GCC and sparse differ,
> 
> 	if, within a macro invocation, that macro is redefined, then the new
> 	definition takes effect in time for argument pre-expansion, but the
> 	original definition is still used for argument replacement. Here is a
> 	pathological example:
> 
> 		#define f(x) x x
> 		f (1
> 		#undef f
> 		#define f 2
> 		f)
> 
> 	which expands to
> 
> 		1 2 1 2
> 
> ./sparse -E outputs
> 
> 	/tmp/M.c:3:1: error: directive in macro's argument list
> 	/tmp/M.c:4:1: error: directive in macro's argument list
> 	2

Not much, indeed. But I see that sparse & gcc differ also in the
non-erroneous case:
	#define f(x) x x
	f(1
	2)

(Sparse adds newlines after the 1s) but it seems easy to solve.

-- Luc

  reply	other threads:[~2020-03-11 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 15:25 [PATCH] Add symantic index utility Alexey Gladkov
2020-03-09 22:37 ` Luc Van Oostenryck
2020-03-10 15:07   ` Oleg Nesterov
2020-03-10 17:12     ` Luc Van Oostenryck
2020-03-11 12:04       ` Oleg Nesterov
2020-03-11 16:47         ` Luc Van Oostenryck
2020-03-11  9:07     ` Dan Carpenter
2020-03-11 11:33       ` Oleg Nesterov
2020-03-11 17:11         ` Luc Van Oostenryck [this message]
2020-03-11 17:06       ` Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311171157.fhpuwphwfn3ek7wm@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gladkov.alexey@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox