Re: Re: Re: Getting info from used typedef

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

 



christ.li@xxxxxxxxx schrieb am 01.12.2009 19:49:18:
> So you only use sparse as a C source code processing tool. You don't
> care about the back end part of the sparse right?

Yes, that's right.

> In that case, you can try this one line patch. It should preserve the 
typedef
> symbol as the base type. I will not commit that to main line though.
> 
> Will that work for you?

Thank you, but I'm sorry, that patch doesn't work for me. 
The output is the same as before, the base_type of the symbol doesn't have 
an ident.

I'm surprised that the base_type had an ident in former versions of sparse 

(which didn't also work correctly - I tried to figure out something in the 
past, see 
http://marc.info/?l=linux-sparse&m=118171213001092&w=2
), but now this has changed.

In former versions of sparse, this code gave output, even tough it was 
incorrect:
("sym" is a "struct symbol*" of the symlist returned by sparse() )

        struct symbol *type;
        type = sym->ctype.base_type;
 
        if (type->ident)
        {
                if (sym->ctype.modifiers & MOD_USERTYPE) 
                        fprintf(pFOut, "Typedef=\"%s\" ", 
type->ident->name);
        } 


I tried to compare the function "declaration_specifiers" from sparse 0.4.1 
and 0.4.2.
The function changed a lot, but I don't understand the changes.

Is it really not necessary for compilers (or frontends) to hold the 
information about declarations with typedefs?

Regards,
Thomas
--
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