seL4_libs icon indicating copy to clipboard operation
seL4_libs copied to clipboard

libsel4utils: remove unused environment setup

Open anchao opened this issue 1 year ago • 0 comments

libsel4utils: remove unused environment setup

It is unnecessary to writing environment to the stack since the target environment size is always 0.

This PR also fix compile warning on native X86 build:

[2/8] Building C object apps/sel4test-driver/seL4_libs/libsel4utils/CMakeFiles/sel4utils.dir/src/process.c.obj
/home/archer/code/sel4/projects/seL4_libs/libsel4utils/src/process.c: In function ‘sel4utils_spawn_process_v’:
/home/archer/code/sel4/projects/seL4_libs/libsel4utils/src/process.c:320:13: warning: ‘sel4utils_stack_copy_args’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=]
  320 |     error = sel4utils_stack_copy_args(vspace, &process->vspace, vka, envc, envp, dest_envp, &initial_stack_pointer);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4utils/src/process.c:320:13: note: referencing argument 5 of type ‘char *[0]’
/home/archer/code/sel4/projects/seL4_libs/libsel4utils/src/process.c:209:12: note: in a call to function ‘sel4utils_stack_copy_args’
  209 | static int sel4utils_stack_copy_args(vspace_t *current_vspace, vspace_t *target_vspace,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
[8/8] Generating ../../images/sel4test-driver-image-x86_64-pc99

anchao avatar Sep 11 '23 07:09 anchao