I found that rand()
function from bionic does't work without including stdlib.h
extern int rand(void);
static void foo()
{
int a = rand();
}
int main()
{
foo()
return 0;
}
Results for glibc
:
Compilation successful
Results for bionic
:
Compilation unsuccessful
error: undefined reference to 'rand'
In bionic
sources we have following implementation:
static __inline__ int rand(void) {
return (int)lrand48();
}
Why it works for glibc
but not for bionic