> -----Original Message-----
> From: Gabriel Kerneis [mailto:kern...@pps.jussieu.fr] 
> Sent: dinsdag 15 mei 2012 15:16
> To: Smets, Jan (Jan)
> Cc: cil-users@lists.sourceforge.net
> Subject: Re: [CIL users] Unused __Cont label
> 
> On Tue, May 15, 2012 at 02:39:52PM +0200, Smets, Jan (Jan) wrote:
> > How can I hack in the unused attribute?
> 
> Currently, CIL does not support attributes for labels.  Do 
> you have some
> evidence that it is supported by the C standard / gcc / whatever?

It's a GCC extention
http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01897.html  Seems to work for c++ 
too.
http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Attribute-Syntax.html (GCC 4.0) als 
mentions labels ("The only attribute it makes sense to use after a label is 
unused.")

> > Or is there another way to fix this?
> 
> We could modify the "unused variables" analysis to also 
> remove unused labels.

That would be great.

> > __Cont: __attribute__ ((__unused__))
> 
> In the meantime, you could write a cilPrinter which 
> overwrites the method pLabel
> to print __attribute__ ((__ununsed__)) after every label 
> introduced by CIL, ie.
> matching Label(_, _, false).

I'll see what I can come up with, but I'm *not* familiar with ocaml.

Thanks!

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to