mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 13:04:35 +03:00
Enable -Wcast-qual compiler warning
This commit is contained in:

committed by
cgzones

parent
ad3acfc847
commit
db472075a4
16
Macros.h
16
Macros.h
@ -33,4 +33,20 @@
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
// ignore casts discarding const specifier, e.g.
|
||||
// const char [] -> char * / void *
|
||||
// const char *[2]' -> char *const *
|
||||
#ifdef __clang__
|
||||
#define IGNORE_WCASTQUAL_BEGIN _Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wcast-qual\"")
|
||||
#define IGNORE_WCASTQUAL_END _Pragma("clang diagnostic pop")
|
||||
#elif defined(__GNUC__)
|
||||
#define IGNORE_WCASTQUAL_BEGIN _Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
|
||||
#define IGNORE_WCASTQUAL_END _Pragma("GCC diagnostic pop")
|
||||
#else
|
||||
#define IGNORE_WCASTQUAL_BEGIN
|
||||
#define IGNORE_WCASTQUAL_END
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user