On Wed, Mar 11, 2020 at 12:37:17PM +0000, Peter Maydell wrote: > On Wed, 11 Mar 2020 at 00:43, Liu, Jingqi <jingqi....@intel.com> wrote: > > 1) If '#include <linux/mman.h>' first then '#include qemu/osdep.h', it > > should be fine. > > > > 2) Peter mentioned osdep.h should go first. > > > > It will cause redefinitions of other MAP_* macros after '#include > > <linux/mman.h>'. > > > > This is where the conflict lies. > > osdep.h first, always. Other uses of linux-headers headers > have presumably already dealt with this issue...
Including linux/mman.h before sys/mman.h is just a workaround to the root cause: both headers really redefine each others' macros, but gcc hide the warnings if the warnings are generated inside system-provided headers. I believe we should use -isystem for linux-headers insteaad of -I. -- Eduardo