ModSecurity
ModSecurity copied to clipboard
clang: warning: comparison of constant 160 with expression of type 'char' is always false
Description
/src/actions/transformations/remove_whitespace.cc:66:44: warning: comparison of constant 160 with expression of type 'char' is always false
#define NBSP 160 // non breaking space char std::string value(val); if (isspace(value[i]) || (value[i] == NBSP)) {
hi! I can work on the fix.
Hi @khushbuparakh,
Thank you for the report. Indeed that will be a valid fix. Sorry for the long delay to answer. It will be a pleasure to have your contribution on that issue.
@khushbuparakh ?
@zimmerle what do you think about the PR #2171?
@zimmerle what do you think about the PR #2171? The comments about #2171 are on #2171.
What do you think about this solution?
-#define NBSP 160 // non breaking space char
+// define NBSP non breaking space char - depends the used type of char
+#if CHAR_MIN <= 0
+#define NBSP -96
+#elif
+#define NBSP 160
+#endif
and we can forgot the static_cast<char>()
.
My idea is that the std::string
is type of std::basic_string<char>
, and the char
could be signed
or unsigned
. We can check this with the condition.
hi! Missed the updates. thanks, @airween for fixing on time