[pim/libksieve] src/ksieve: parser.cpp - use pragmas to hide -Wimplicit-const-int-float-conversion

Allen Winter <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit f4c6bdd50b89728fab0784e21fff4fd8a65aebea by Allen Winter.
Committed on 28/07/2026 at 15:13.
Pushed by winterz into branch 'master'.

parser.cpp - use pragmas to hide -Wimplicit-const-int-float-conversion

The code is on-purpose to check for unsigned long over-flows.

Fixes:
```
+ src/ksieve/parser.cpp:
  -  90:implicit conversion from 'unsigned long' to 'double' changes
        value from 18446744073709551615 to 18446744073709551616
```

M  +4    -0    src/ksieve/parser.cpp

https://invent.kde.org/pim/libksieve/-/commit/f4c6bdd50b89728fab0784e21fff4fd8a65aebea

diff --git a/src/ksieve/parser.cpp b/src/ksieve/parser.cpp
index 29ca0a8d..9ffa9a3e 100644
--- a/src/ksieve/parser.cpp
+++ b/src/ksieve/parser.cpp
@@ -82,11 +82,15 @@ static inline unsigned long factorForQuantifier(char ch)
     }
 }
 
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_GCC("-Wimplicit-const-int-float-conversion")
+QT_WARNING_DISABLE_CLANG("-Wimplicit-const-int-float-conversion")
 static inline bool willOverflowULong(unsigned long result, unsigned long add)
 {
     static const auto maxULongByTen = (unsigned long)(ULONG_MAX / 10.0);
     return result > maxULongByTen || ULONG_MAX - 10 * result < add;
 }
+QT_WARNING_POP
 
 namespace KSieve
 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.