Package: sparse
Version: 0.4.1+git20081218-1
Hello Pierre,
sparse report 'error: marked inline, but without a definition' for the
following program.
However the construct is valid, so an error is not warranted, and in the event
a warning
(I cannot see why) should be reported, it should be at the call site, not at
the prototype.
%cat foo.c
#include <stdio.h>
static inline long dist(long x, long y);
static inline long dist3(long x, long y, long z) { return dist(x,y)+z*z; }
static inline long dist(long x, long y) { return x*x+y*y; }
long fun(long x, long y, long z) { return dist3(x+y,x-y, z); }
int main(void)
{
return printf("%ld\n",fun(1,2,3));
}
%cgcc -O2 -Wall foo.c -o foo
foo.c:2:24: error: marked inline, but without a definition
%gcc -O2 -Wall foo.c -o foo
%./foo
19
%objdump -S foo|grep dist
%
Cheers,
--
Bill. <[email protected]>
Imagine a large red swirl here.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]