[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V3] vl.c && linux-user/main.c : removed **envp f
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH V3] vl.c && linux-user/main.c : removed **envp from main() arguments |
Date: |
Tue, 19 Dec 2017 11:21:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
Le 19/12/2017 à 11:11, Yoni Bettan a écrit :
> it was added on 2008 902b3d5c39 when introduced cache-utils.[ch]
>
> since then cache-utils.[ch] were removed but **envp was left
> behind.
>
> By the way "to be portable it is best to write main to take two
> arguments, and use the value of environ" according to
> https://www.gnu.org/software/libc/manual/html_node/Program-\
> Arguments.html#Program-Arguments
>
> Signed-off-by: Yoni Bettan <address@hidden>
> ---
>
> V2 -> V3:
>
> since ui/cocoa.c rename main() is using qemu_main() ,because it uses it
> inside its main() function, the function qemu_main() can't be removed
>
>
> V1 -> V2:
>
> removed the ui/cocoa.c renaming of main() function since i thought that
> we
> no longer need qemu_main()
>
>
> include/qemu-common.h | 2 +-
> linux-user/main.c | 2 +-
> ui/cocoa.m | 5 ++---
> vl.c | 7 +++----
> 4 files changed, 7 insertions(+), 9 deletions(-)
>
...
> diff --git a/vl.c b/vl.c
> index fc8bd9372f..ea17cc34f6 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -35,10 +35,10 @@
> #ifdef CONFIG_SDL
> #if defined(__APPLE__) || defined(main)
> #include <SDL.h>
> -int qemu_main(int argc, char **argv, char **envp);
> +int qemu_main(int argc, char **argv);
> int main(int argc, char **argv)
> {
> - return qemu_main(argc, argv, NULL);
> + return qemu_main(argc, argv);
> }
> #undef main
> #define main qemu_main
I'm really sorry, but I really think we can remove this part.
This does not break the call of qemu_main from COCOA because we keep:
48 #ifdef CONFIG_COCOA
49 #undef main
50 #define main qemu_main
51 #endif /* CONFIG_COCOA */
Thanks,
Laurent