Hi! On Tue, 29 Dec 2015 18:10:27 +0100, Flavio Cruz <[email protected]> wrote: > exec: Fix compiler warnings. > > * exec/elfcore.c: Cast arguments to vm_address_t. > * exec/main.c: Use %lu in asprintf.
> --- a/exec/elfcore.c
> +++ b/exec/elfcore.c
> @@ -408,8 +408,8 @@ dump_core (task_t task, file_t file, off_t corelimit,
> if (err == 0)
> {
> err = proc_get_arg_locations (proc,
> - &psinfo.data.pr_argv,
> - &psinfo.data.pr_envp);
> + (vm_address_t *) &psinfo.data.pr_argv,
> + (vm_address_t *)
> &psinfo.data.pr_envp);
Reverted that change, to simplify the code:
commit d213bd8ef04dd947ff5c53a8efeb6cba11621396
Author: Thomas Schwinge <[email protected]>
Date: Mon May 23 11:30:47 2016 +0200
Revert part of "fix compiler warnings in hurd/exec"
This reverts part of commit 05c3ffac543052c8d0b171a5f77bb977d5316a61. These
type casts are no longer needed after the commit
e914bfc3d6e5ddf6f8c5e93a4334873a48a24ddf changes.
* exec/elfcore.c: Revert type casts added in commit
05c3ffac543052c8d0b171a5f77bb977d5316a61.
---
exec/elfcore.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git exec/elfcore.c exec/elfcore.c
index 4840217..3e4551e 100644
--- exec/elfcore.c
+++ exec/elfcore.c
@@ -408,8 +408,8 @@ dump_core (task_t task, file_t file, off_t corelimit,
if (err == 0)
{
err = proc_get_arg_locations (proc,
- (vm_address_t *) &psinfo.data.pr_argv,
- (vm_address_t *)
&psinfo.data.pr_envp);
+ &psinfo.data.pr_argv,
+ &psinfo.data.pr_envp);
mach_port_deallocate (mach_task_self (), proc);
}
{
> --- a/exec/main.c
> +++ b/exec/main.c
> @@ -145,7 +145,7 @@ trivfs_append_args (struct trivfs_control *fsys,
>
> if (MACH_PORT_VALID (opt_device_master))
> {
> - asprintf (&opt, "--device-master-port=%d", opt_device_master);
> + asprintf (&opt, "--device-master-port=%lu", opt_device_master);
;-) Strictly speaking, that's not correct: opt_device_master is a
mach_port_t, and there is no requirement for that one to correspond
exactly to an "unsigned long int". But, I guess, we have a lot of code
making such assumptions, so let's not worry about that for the moment.
Grüße
Thomas
signature.asc
Description: PGP signature
