Interesting (?) failure case

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

 



Try linearizing this with 'sparse', and see it fail miserably:

   int t(void)
   {
        goto inside;
        return 0 ?
                 ({ inside: return 3; 1; })
                :
                 2;
   }

I came up with that disgusting example after talking to Nick
Desaulniers about how sparse does some front-end optimizations early,
and it made me go "Hmm... What about.."

There are two reasonable approaches for the above:

 - return 3 (due to the "goto inside")

 - tell the user to pound sand for doing crazy things and jumping into
a statement expression from outside.

clang does #1. gcc does #2.

sparse does something bad, and just generates garbage silently.

             Linus



[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