[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2] include/essentials: Fix redefinition warnings when using newlib


  • To: Costin Lupu <costin.lupu@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
  • Date: Wed, 10 Apr 2019 08:15:23 +0000
  • Accept-language: en-GB, gl-ES, de-DE, en-US
  • Delivery-date: Wed, 10 Apr 2019 08:15:37 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHU5loH1AtxmKUWMUiGXZijN48ZfaY1HmKA
  • Thread-topic: [UNIKRAFT PATCH v2] include/essentials: Fix redefinition warnings when using newlib

Thanks! I am going to upstream it.

Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 29.03.19, 19:05, "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 | 14 ++++++++++++++
     1 file changed, 14 insertions(+)
    
    diff --git a/include/uk/essentials.h b/include/uk/essentials.h
    index 47e04f7c..d9b24fcb 100644
    --- a/include/uk/essentials.h
    +++ b/include/uk/essentials.h
    @@ -38,6 +38,20 @@
     #ifndef __UK_ESSENTIALS_H__
     #define __UK_ESSENTIALS_H__
     
    +#include <uk/config.h>
    +
    +#if CONFIG_LIBNEWLIBC
    +/*
    + * Needed for __used, __unused, __packed, __section,
    + *   __nonnull, __offsetof, __containerof
    + */
    +#include <sys/cdefs.h>
    +/* Needed for __STRINGIFY */
    +#include <sys/param.h>
    +/* Needed for MIN, MAX */
    +#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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.