All of lore.kernel.org
 help / color / mirror / Atom feed
* Sparse parsing question: symbols in parse tree
@ 2017-08-20 21:51 Dibyendu Majumdar
  2017-08-20 22:09 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Dibyendu Majumdar @ 2017-08-20 21:51 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

Whenever an EXPR_SYMBOL is encountered does this actually equate to
the address of the symbol?

Regards
Dibyendu

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

* Re: Sparse parsing question: symbols in parse tree
  2017-08-20 21:51 Sparse parsing question: symbols in parse tree Dibyendu Majumdar
@ 2017-08-20 22:09 ` Linus Torvalds
  2017-08-20 22:15   ` Dibyendu Majumdar
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2017-08-20 22:09 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Sun, Aug 20, 2017 at 2:51 PM, Dibyendu Majumdar
<mobile@majumdar.org.uk> wrote:
>
> Whenever an EXPR_SYMBOL is encountered does this actually equate to
> the address of the symbol?

Yes, it should.

Note that not all EXPR_SYMBOL are really symbols in the C sense. As
mentioned in another thread, you can also have anonymous symbols -
they act kind of like a named variable, just without the name.

The most common case of an anonymous symbol is a constant string, but
we do the general case of "cast followed by an initializer" as an
anonymous symbol of any type.

              Linus

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

* Re: Sparse parsing question: symbols in parse tree
  2017-08-20 22:09 ` Linus Torvalds
@ 2017-08-20 22:15   ` Dibyendu Majumdar
  0 siblings, 0 replies; 3+ messages in thread
From: Dibyendu Majumdar @ 2017-08-20 22:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-Sparse

Hi Linus,

On 20 August 2017 at 23:09, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sun, Aug 20, 2017 at 2:51 PM, Dibyendu Majumdar
> <mobile@majumdar.org.uk> wrote:
>>
>> Whenever an EXPR_SYMBOL is encountered does this actually equate to
>> the address of the symbol?
>
> Yes, it should.
>
> Note that not all EXPR_SYMBOL are really symbols in the C sense. As
> mentioned in another thread, you can also have anonymous symbols -
> they act kind of like a named variable, just without the name.
>
> The most common case of an anonymous symbol is a constant string, but
> we do the general case of "cast followed by an initializer" as an
> anonymous symbol of any type.
>

That's interesting - thanks!

Regards
Dibyendu

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

end of thread, other threads:[~2017-08-20 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-20 21:51 Sparse parsing question: symbols in parse tree Dibyendu Majumdar
2017-08-20 22:09 ` Linus Torvalds
2017-08-20 22:15   ` Dibyendu Majumdar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.