[PATCH] Add missing #include <unistd.h> to libdl.c

Denys Vlasenko vda.linux at googlemail.com
Sun May 25 20:03:04 UTC 2008


On Saturday 24 May 2008 11:07, Carmelo Amoroso wrote:
> Haavard Skinnemoen wrote:
> > Fixes the following error on avr32
> > 
> >   CC ldso/libdl/libdl.oS
> > ldso/libdl/libdl.c: In function 'dlopen':
> > ldso/libdl/libdl.c:167: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_dl_init'
> > ldso/libdl/libdl.c:167: error: '_dl_init' undeclared (first use in this function)
> > ldso/libdl/libdl.c:167: error: (Each undeclared identifier is reported only once
> > ldso/libdl/libdl.c:167: error: for each function it appears in.)
> > ---
> >  ldso/libdl/libdl.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
> > index 1618e7b..10292bf 100644
> > --- a/ldso/libdl/libdl.c
> > +++ b/ldso/libdl/libdl.c
> > @@ -33,6 +33,7 @@
> >  #include <ldso.h>
> >  #include <stdio.h>
> >  #include <string.h>
> > +#include <unistd.h>
> >  
> >  
> >  #ifdef SHARED
> Hi,
> I think that is was already fixed by Bernard
> by using bool instead of smallint for _dl_init.

I am not really too obsessed by it, but I have a rationale
why I dont use bool:

On Tuesday 20 May 2008 17:59, Denys Vlasenko wrote:
> On Tuesday 20 May 2008 09:15, Bernhard Fischer wrote:
> > For cases like this i prefer to just use a bool.
> 
> Yeah, sounds logical. I'd do this too, but I don't have sufficient faith
> in gcc not being stupid.
> 
> From past experience, gcc *can be* stupid. On i386, it aligns
> explicitly defined string arrays to 32 bits. (That's why bbox has
> ugly ALIGN1 macro). At least some versions of gcc were aligning
> any array bigger than 32 bytes to 32 bytes. Yes, that's BYTES,
> not BITS.
> 
> I can easily imagine that on some architecture gcc may have
> 32-bit bool. It may be dictated by ABI or gcc may just be stupid again.
> I'd prefer to not being constrained by gcc's choice,
> but to make this choice independently from gcc.

Maybe I am too paranoid? What do you think
--
vda



More information about the uClibc mailing list