qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/2] Use -isystem for linux-headers dir


From: Peter Maydell
Subject: Re: [PATCH v2 1/2] Use -isystem for linux-headers dir
Date: Thu, 12 Mar 2020 10:17:38 +0000

On Wed, 11 Mar 2020 at 23:23, Eduardo Habkost <address@hidden> wrote:
>
> glibc and Linux-provided headers are known to generate macro
> redefinition warnings when used together.  For example:
> <linux/mman.h> and <sys/mman.h> duplicate some macro definitions.
>
> We normally never see those warnings because GCC suppresses
> warnings generated by system headers.  We carry our own copy of
> Linux header files, though, and this makes those warnings not be
> suppressed when glibc headers are included before Linux headers
> (e.g. if <sys/mman.h> is included before <linux/mman.h>).
>
> Use -isystem instead of -I for linux-headers.  This makes the
> compiler treat our linux-headers directory the same way it treats
> system-provided Linux headers, and suppress warnings generated by
> them.

I wondered whether this changed the search order for the headers
(ie whether it meant we now picked up our copy of the header
and not the system header in some cases), but both -I and -isystem
directories are searched before the standard system headers,
so the only effect is the warning suppression.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]