[cfe-dev] NonNull attribute, bug report. (Or misunderstanding)
Paolo Bolzoni
bolzoni at cs.unipr.it
Thu Dec 4 04:27:08 PST 2008
Simple declaration:
extern void* my_memcpy (void *dest, const void *src, unsigned long len)
__attribute__((nonnull (1, 2)));
The relative AST vertex do have the clang::Attr pointer. But this simple loop
outputs nothing:
my_decl is a clang::FunctionDecl* relative to the function declaration.
non_null_attribute is a clang::NonNullAttr* relative to the non null attribute
of my_decl.
for (unsigned int e = my_decl-> getNumParams(), b = 1; b <= e; ++b) {
if (non_null_attribute-> isNonNull(b)) {
std::cout << "Yes, parameter " << b << "is non-null!" << std::endl;
}
}
What am I doing wrong? Or there indeed is a clang bug somewhere?
pb
More information about the cfe-dev
mailing list