1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00

Use uintptr_t instead of performing pointer subtraction with a null pointer

Signed-off-by: Qihao Chencao <twose@qq.com>

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Qihao Chencao
2022-06-28 16:57:55 +08:00
committed by Adhemerval Zanella
parent dab6344279
commit cc4d6614b5
12 changed files with 35 additions and 36 deletions

View File

@@ -239,7 +239,7 @@ parse_list (char **linep, char *eol, char *buf_end, int terminator_c,
/* Adjust the pointer so it is aligned for storing pointers. */
eol += __alignof__ (char *) - 1;
eol -= (eol - (char *) 0) % __alignof__ (char *);
eol -= ((uintptr_t) eol) % __alignof__ (char *);
/* We will start the storage here for the vector of pointers. */
list = (char **) eol;