Gabriele,

On Thu, Sep 30, 2010 at 12:18:12PM +0200, Gabriele Palma wrote:
> I'm trying to use GCC to reprocess a file containing some Gcc
> extension to a source file without these, as i read it to be possible
> in the documentation.

CIL does indeed remove some gcc extensions, detailed here:
http://www.eecs.berkeley.edu/~necula/cil/cil010.html
This does not include (gcc) attributes, which are preserved, as
explained here:
http://www.eecs.berkeley.edu/~necula/cil/attributes.html#sec-attrib

> Are these __attribute__ definition supposed to be there?

Yes.

> Am i doing something wrong?

No.

> Also, in other part of the code i've seen the __restrict word which is
> not standard as far as i know.

"restrict" is a keyword added in C99. "__restrict" is an attribute with
the same semantics, used for compatibility with older compilers.
AFAICT, CIL does not handle it as a keyword, but as an attribute:
  "The attributes for base types and for pointer types are a strict
  extension of the ANSI C type qualifiers (const, volatile and
  restrict).  In fact CIL treats these qualifiers as attributes."
  http://www.eecs.berkeley.edu/~necula/cil/attributes.html#sec-attrib

> Is there the possibility to remove these and have a fully clean code
> or these extension are not supported or explicitly allowed by CIL?

Well, every attribute is parsed and stored by CIL.  They are not removed
by default, because they might carry some important semantics value.

Of course, you can write a simple CIL module which would delete every
attribute (or some of them, selectively).  But then, you should know
precisely which attributes you are willing to discard, why, and what the
consequences will be on your program.

Maybe if you answer those questions, we can help you to solve the
problem.

Best regards,
-- 
Gabriel Kerneis

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to