Re: Sparse parsing question: string literal

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

 



On Sun, Aug 20, 2017 at 8:31 AM, Dibyendu Majumdar
<mobile@xxxxxxxxxxxxxxx> wrote:
> Hi,
>
> I am looking at the parse tree for following snippet:
>
> void main(int argc, const char *argv[])
> {
> 5;
> 6.5;
> "hello";
> }
>
> I see that 5 is treated as EXPR_VALUE, 6.5 as EXPR_FVALUE, but "hello"
> is treated as EXPR_SYMBOL. Why is that?

Because "hello" is array of char from type point of view.

It is same as
char no_ident [] = {'h', 'e', 'l', 'l', 'o', '\0'};

except it does not have the name(sym->ident) for this symbol.

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