* [Qemu-devel] [PATCH] Drop unneeded system header includes
@ 2018-02-07 16:03 Eric Blake
2018-02-07 16:15 ` Philippe Mathieu-Daudé
2018-02-07 19:26 ` Thomas Huth
0 siblings, 2 replies; 3+ messages in thread
From: Eric Blake @ 2018-02-07 16:03 UTC (permalink / raw)
To: qemu-devel
Cc: armbru, qemu-trivial, Paolo Bonzini, Richard Henderson,
Eduardo Habkost
<memory.h> is a non-standard obsolete header that was long ago
replaced by <string.h>.
<malloc.h> is a non-standard header; it is not obsolete (we must
use it for malloc_trim, for example), but generally should not
be used in files that just need malloc() and friends, where
<stdlib.h> is the standard header.
And since osdep.h already guarantees string.h and stdlib.h, we
can drop these unusual system header includes as redundant
rather than replacing them.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
Based-on: <20180207124009.12376-1-armbru@redhat.com>
([PULL 00/20] Miscellaneous patches for 2018-02-07)
target/i386/hax-windows.h | 2 --
target/i386/hvf/x86_mmu.c | 1 -
2 files changed, 3 deletions(-)
diff --git a/target/i386/hax-windows.h b/target/i386/hax-windows.h
index 004f8676949..20e2f85407b 100644
--- a/target/i386/hax-windows.h
+++ b/target/i386/hax-windows.h
@@ -20,8 +20,6 @@
#ifndef TARGET_I386_HAX_WINDOWS_H
#define TARGET_I386_HAX_WINDOWS_H
-#include <memory.h>
-#include <malloc.h>
#include <winioctl.h>
#include <windef.h>
diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c
index c6be2cca357..d5a0efe7188 100644
--- a/target/i386/hvf/x86_mmu.c
+++ b/target/i386/hvf/x86_mmu.c
@@ -17,7 +17,6 @@
*/
#include "qemu/osdep.h"
-#include <memory.h>
#include "panic.h"
#include "qemu-common.h"
#include "cpu.h"
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Drop unneeded system header includes
2018-02-07 16:03 [Qemu-devel] [PATCH] Drop unneeded system header includes Eric Blake
@ 2018-02-07 16:15 ` Philippe Mathieu-Daudé
2018-02-07 19:26 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-02-07 16:15 UTC (permalink / raw)
To: Eric Blake, qemu-devel
Cc: qemu-trivial, Paolo Bonzini, armbru, Eduardo Habkost,
Richard Henderson
On 02/07/2018 01:03 PM, Eric Blake wrote:
> <memory.h> is a non-standard obsolete header that was long ago
> replaced by <string.h>.
>
> <malloc.h> is a non-standard header; it is not obsolete (we must
> use it for malloc_trim, for example), but generally should not
> be used in files that just need malloc() and friends, where
> <stdlib.h> is the standard header.
>
> And since osdep.h already guarantees string.h and stdlib.h, we
> can drop these unusual system header includes as redundant
> rather than replacing them.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>
> Based-on: <20180207124009.12376-1-armbru@redhat.com>
> ([PULL 00/20] Miscellaneous patches for 2018-02-07)
>
> target/i386/hax-windows.h | 2 --
> target/i386/hvf/x86_mmu.c | 1 -
> 2 files changed, 3 deletions(-)
>
> diff --git a/target/i386/hax-windows.h b/target/i386/hax-windows.h
> index 004f8676949..20e2f85407b 100644
> --- a/target/i386/hax-windows.h
> +++ b/target/i386/hax-windows.h
> @@ -20,8 +20,6 @@
> #ifndef TARGET_I386_HAX_WINDOWS_H
> #define TARGET_I386_HAX_WINDOWS_H
>
> -#include <memory.h>
> -#include <malloc.h>
> #include <winioctl.h>
> #include <windef.h>
>
> diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c
> index c6be2cca357..d5a0efe7188 100644
> --- a/target/i386/hvf/x86_mmu.c
> +++ b/target/i386/hvf/x86_mmu.c
> @@ -17,7 +17,6 @@
> */
>
> #include "qemu/osdep.h"
> -#include <memory.h>
> #include "panic.h"
> #include "qemu-common.h"
> #include "cpu.h"
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Drop unneeded system header includes
2018-02-07 16:03 [Qemu-devel] [PATCH] Drop unneeded system header includes Eric Blake
2018-02-07 16:15 ` Philippe Mathieu-Daudé
@ 2018-02-07 19:26 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2018-02-07 19:26 UTC (permalink / raw)
To: Eric Blake, qemu-devel
Cc: qemu-trivial, Paolo Bonzini, armbru, Eduardo Habkost,
Richard Henderson
On 07.02.2018 17:03, Eric Blake wrote:
> <memory.h> is a non-standard obsolete header that was long ago
> replaced by <string.h>.
>
> <malloc.h> is a non-standard header; it is not obsolete (we must
> use it for malloc_trim, for example), but generally should not
> be used in files that just need malloc() and friends, where
> <stdlib.h> is the standard header.
>
> And since osdep.h already guarantees string.h and stdlib.h, we
> can drop these unusual system header includes as redundant
> rather than replacing them.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>
> Based-on: <20180207124009.12376-1-armbru@redhat.com>
> ([PULL 00/20] Miscellaneous patches for 2018-02-07)
>
> target/i386/hax-windows.h | 2 --
> target/i386/hvf/x86_mmu.c | 1 -
> 2 files changed, 3 deletions(-)
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-07 19:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-07 16:03 [Qemu-devel] [PATCH] Drop unneeded system header includes Eric Blake
2018-02-07 16:15 ` Philippe Mathieu-Daudé
2018-02-07 19:26 ` Thomas Huth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).