[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH] include/essentials: Fix redefinition warnings when using newlib
Done, I just sent a v2. Costin On 3/29/19 4:25 PM, Simon Kuenzer wrote: > Hey, > > I double checked this with musl and you are actually right, this is quiet > libnewlib dependent. Although I do not like it, it is how it is ;-) . Could > you add small comments to each include that tells why we are including it, > just for keeping track? > We anyway have probably to go back to this when we have support for another > libc (like musl). > > Thanks, > > Simon > > On 22.03.19, 15:37, "Costin Lupu" <costin.lup@xxxxxxxxx> wrote: > > Hi Simon, > > For now I think it's better to stick to newlib because it might be that > only newlib chose to define those macro regardless whether they were > already defined before. If the same would apply for other libc > implementation then we'll update this when we'll use those other libc's. > > Thanks, > Costin > > On 3/22/19 4:32 PM, Simon Kuenzer wrote: > > Hey Costin, > > > > thanks a lot for this patch. In fact it solves some redefinition errors > that we experience. The workaround so far was to include libc headers first > and then essentials.h. But I agree it might not always work because of > dependencies. > > > > Instead of making this depending on newlib, can we make it libc generic > by using CONFIG_HAVE_LIBC instead? > > > > Thanks, > > > > Simon > > > > On 12.03.19, 07:32, "Costin Lupu" <costin.lupu@xxxxxxxxx> wrote: > > > > For some macrodefinitions, newlib headers do not care if they were > > previously defined and this results in redefinitions compiler > warnings. > > In some way, it makes sense to give priority to newlib's > definitions if > > one decides to use it as a libc implementation. Therefore we > include the > > newlib headers in essentials.h to give priority to their definitions > > instead of ours. > > > > Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> > > --- > > include/uk/essentials.h | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/include/uk/essentials.h b/include/uk/essentials.h > > index 47e04f7c..cdcb5625 100644 > > --- a/include/uk/essentials.h > > +++ b/include/uk/essentials.h > > @@ -38,6 +38,14 @@ > > #ifndef __UK_ESSENTIALS_H__ > > #define __UK_ESSENTIALS_H__ > > > > +#include <uk/config.h> > > + > > +#if CONFIG_LIBNEWLIBC > > +#include <sys/cdefs.h> > > +#include <sys/param.h> > > +#include <inttypes.h> > > +#endif > > + > > #ifdef __cplusplus > > extern "C" { > > #endif > > -- > > 2.11.0 > > > > > > > > _______________________________________________ > > Minios-devel mailing list > > Minios-devel@xxxxxxxxxxxxxxxxxxxx > > https://lists.xenproject.org/mailman/listinfo/minios-devel > > > > _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |