Re: Getting info from used typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 25, 2009 at 6:15 AM, Thomas Schmid
<Thomas.Schmid@xxxxxxxxxxxxxxxxx> wrote:
> typedef signed short INT;
> INT var1;
>
> When i iterate over the symbol_list which is returend by sparse(), I can
> get the information,
> that "var1" was declared using a typedef, this information is held in
> "symbol->ctype.modifiers".

So far so good.

> Can you tell me how I can examine the name of the typedef - "INT", which
> was used in the declaration?

I take a look at the current code base, there is no good way to get the
typedef from the symbol node. When sparse parse the "INT" token.
It will try to lookup it as type define. If it is, sparse directly
apply the underlying
ctype, which is "signed short", to var1.

The code does that is in declaration_specifiers() if you are curious.
Sparse only use the base type of the user type, as if the declaration
is "signed short var1". This make the later process much easier.
It is none trivial change to preserve the type define name.

May I ask more back ground information what do you want to do
with the type define name? I am trying to find out if there is other easier
way to achieve your goal.

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

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux