* 'sint-max' of https://github.com/t-8ch/util-linux:
  c.h: avoid undefined behavior in SINT_MAX macro
This commit is contained in:
Karel Zak 2023-01-12 14:35:50 +01:00
commit 8d9215504c

View file

@ -526,6 +526,6 @@ static inline void print_features(const char **features, const char *prefix)
# define MAP_ANONYMOUS (MAP_ANON)
#endif
#define SINT_MAX(t) (((size_t) 1 << (sizeof(t) * 8 - 1)) - 1)
#define SINT_MAX(t) ((t)((~(t) 0) ^ (t) 1 << (sizeof(t) * 8 - 1)))
#endif /* UTIL_LINUX_C_H */