On Tuesday 02 June 2009 11:04:27 Bernhard Reutner-Fischer wrote:
> On Tue, Jun 02, 2009 at 10:29:55AM +0200, Mikael Lund Jepsen, ICCC wrote:
> > Hi all,
> > As I have received interest from multiple sides over the last week or so
> > in getting shm to work, I guess it is time I took this up again and
> > finished it.
> > (Alexander: Your mailprovider blocks my IP for unknown reasons, so I
> > have not been able to get through to you).
> >
> > I have however run into a few problems:
> >
> > Bernhard Reutner-Fischer wrote:
> >> The argument name should be flagged with attribute_nonnull.
> >
> > I cannot get this to work. As per some googling and grepping for nonnull
> > in other uclibc sources, I've tried
> > __nonnull;
> > __nonnull((1));
> > __attribute((nonnull(1)));
> > and possibly a few more variations thereof. The result is however always
> > in the lines of:
> > error: expected identifier or '(' before '{' token
> > I guess I'm missing a point somewhere, but fail to see it. Can someone
> > please enlighten me?
>
> has do be put on the fn-decl e.g.:
> static ssize_t foo(char *x, int i) __nonnull((1));
> static ssize_t foo(char *x, int i) {return strlen(x);}
this isnt entirely true. if you wish to place the attribute after the
function signature, then there can be no body. but placing it before always
works.
__nonnull((1)) static ssize_t foo(char *x, int i) {return strlen(x);}
of course when putting a prototype in a shared header file, this aspect doesnt
matter and so the attribute should be at the end to be consistent.
-mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
