Skip to content

Commit

Permalink
libsafec: wmemset_s.c scilence compilation warning
Browse files Browse the repository at this point in the history
We can safely cast wchar_t * to uint32_t in this case, in order to silence the
following warning:

safeclib/wmemset_s.c: In function ‘wmemset_s’:
safeclib/wmemset_s.c:101:20: warning: pointer targets in passing argument 1 of ‘mem_prim_set32’ differ in signedness [-Wpointer-sign]
     mem_prim_set32(dest, len, value);
                    ^~~~
In file included from safeclib/wmemset_s.c:34:
safeclib/mem_primitives_lib.h:71:1: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘wchar_t *’ {aka ‘int *’}

mem_prim_set32(uint32_t *dest, uint32_t dmax, uint32_t value);

Signed-off-by: Tomas Winkler <[email protected]>
  • Loading branch information
tomasbw committed Aug 8, 2019
1 parent 5f8ce19 commit 652d134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion safeclib/wmemset_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ wmemset_s (wchar_t *dest, wchar_t value, rsize_t len)
return (RCNEGATE(ESLEMAX));
}

mem_prim_set32(dest, len, value);
mem_prim_set32((uint32_t *)dest, len, value);

return (RCNEGATE(EOK));
}
Expand Down

0 comments on commit 652d134

Please sign in to comment.