summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index b1b50ff637..0f4b7f845c 100644
--- a/handy.h
+++ b/handy.h
@@ -910,7 +910,10 @@ patched there. The file as of this writing is cpan/Devel-PPPort/parts/inc/misc
* of operands. Well, they are, but that is kind of the point.
*/
#ifndef __COVERITY__
-#define FITS_IN_8_BITS(c) ((sizeof(c) == 1) || !(((WIDEST_UTYPE)(c)) & ~0xFF))
+ /* The '| 0' part ensures a compiler error if c is not integer (like e.g., a
+ * pointer) */
+#define FITS_IN_8_BITS(c) ( (sizeof(c) == 1) \
+ || !(((WIDEST_UTYPE)(c | 0)) & ~0xFF))
#else
#define FITS_IN_8_BITS(c) (1)
#endif