diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-07-14 23:31:50 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-29 09:32:13 -0400 |
commit | a1b633df55d5207b49ce145ede783d671385854c (patch) | |
tree | ed8a3a52adb75ba8416bd1c9a6fe808ea5391b7d /doc | |
parent | 0c4e81e0eb6bec3aab1f4500f8fb347202c5b601 (diff) |
lib: uuid: alignment error in gen_rand_uuid()
Packed structures like struct uuid are not aligned. GCC 9.1 therefore
throws an error when trying to compile gen_rand_uuid().
lib/uuid.c: In function ‘gen_rand_uuid’:
lib/uuid.c:244:2: error: converting a packed ‘struct uuid’ pointer
(alignment 1) to a ‘unsigned int’ pointer (alignment 4) may result in
an unaligned pointer value [-Werror=address-of-packed-member]
244 | unsigned int *ptr = (unsigned int *)&uuid;
| ^~~~~~~~
Generate the uuid in a properly aligned buffer.
The byte order of a random number should not matter. Do not call
cpu_to_be32() to change the byte order.
Reported-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions