[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New function xpalloc in module xalloc

From: Marc Nieper-Wißkirchen
Subject: New function xpalloc in module xalloc
Date: Sun, 4 Apr 2021 08:17:08 +0200

GCC prints the following warning when compiling the new code:

lib/xmalloc.c: In function 'xpalloc':
lib/xmalloc.c:132:64: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'idx_t' {aka 'long int'} [-Wsign-compare]
  132 |     = ((INT_MULTIPLY_WRAPV (n, item_size, &nbytes) || SIZE_MAX < nbytes)

If I understand the error message correctly, it is because 'nbytes' is a signed type while SIZE_MAX is unsigned.

Does the comparison make any sense, by the way?

Thanks for investigating,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]