This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] noclobber & noescape annotations for function arguments


On 04/16/2010 01:11 AM, Chris Lattner wrote:
void foo(int __attribute__((const)) *x)

could designate that the function only reads from X or something?

Indeed, for example:


- const = only read
- output = only (always?) written, *T is dead on entry
- nonnull = alternative form of the nonnull function attribute
- alloc_size (n) = only x[0]..x[n-1] is read/written, useful for n=1 and for warnings maybe
- malloc = for T ** arguments, *T does not alias anything upon exit
- noderef = pointer is not dereferenced, but still it might escape
- noescape = pointer does not escape


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]