linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* preop expression and variable
@ 2014-03-21 11:02 Guillaume Oberlé
  2014-03-21 18:13 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Oberlé @ 2014-03-21 11:02 UTC (permalink / raw)
  To: linux-sparse

Hi,

I'm an intern and I'm working on a project that aims to use sparse to generate a Json AST of an OpenCL code. Inspired by ast-inspect.c, I've started writing a C to Json program for sparse, and I have some issues.

Here is the code : https://gist.github.com/goberle/b867d29c1b833cf55d36 and here is an example of the output : https://gist.github.com/goberle/e3e8e35bf6a05ea86a6d.

If you look at the output (l117 or l133), I have a PreopExpression before every variable in an expression statement, even if I have no preoperator. I wonder if these are usefull, and if so, what they represent ? (EXPR_PREOP case is defined at line 443 in the code)

Thank you for your time and feel free to contact me if you have any other suggestions.

goberle

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: preop expression and variable
  2014-03-21 11:02 preop expression and variable Guillaume Oberlé
@ 2014-03-21 18:13 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2014-03-21 18:13 UTC (permalink / raw)
  To: Guillaume Oberlé; +Cc: Sparse Mailing-list

On Fri, Mar 21, 2014 at 4:02 AM, Guillaume Oberlé <goberle@ygg.tf> wrote:
>
> If you look at the output (l117 or l133), I have a PreopExpression before every variable in an expression statement, even if I have no preoperator.

You need to look at what the op is too, not just the type.

I assume you're talking about EXPR_PREOP-'*'. That's a dereference
("lvalue access").  And yes, it's required. A symbol on its own is
just the address or the symbol. Actually *accessing* that symbol is
that PREOP-*.

            Lnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-21 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-21 11:02 preop expression and variable Guillaume Oberlé
2014-03-21 18:13 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).