ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.25k stars 519 forks source link

Fix compilation with `-Wtype-limits` #1621

Closed Nerixyz closed 3 months ago

Nerixyz commented 3 months ago

CI currently fails, because of a check if an unsigned integer is greater or equal to zero. This PR removes the check, getting rid of a warning in GCC and making CI green. Clang emits a similar warning if -Wtype-limits is passed (enabling -Wtautological-unsigned-zero-compare), which isn't enabled through -pedantic -Wpedantic -Wall -Wextra -Werror (thus Apple-Clang doesn't complain).


Aside:

All .clang-formats are currently broken [at least with 18.1], because of a duplicate AfterStruct.

Diff ```diff diff --git a/.clang-format b/.clang-format index f75a5542..9a25bae9 100644 --- a/.clang-format +++ b/.clang-format @@ -74,7 +74,6 @@ BraceWrapping: AfterControlStatement: false AfterClass: false AfterNamespace: false - AfterStruct: false AfterUnion: false BeforeElse: true BeforeCatch: true diff --git a/documentation/.clang-format b/documentation/.clang-format index 00ef7c2c..b2a47e16 100644 --- a/documentation/.clang-format +++ b/documentation/.clang-format @@ -74,7 +74,6 @@ BraceWrapping: AfterControlStatement: false AfterClass: false AfterNamespace: false - AfterStruct: false AfterUnion: false BeforeElse: true BeforeCatch: true diff --git a/examples/.clang-format b/examples/.clang-format index 9807f392..1c209463 100644 --- a/examples/.clang-format +++ b/examples/.clang-format @@ -74,7 +74,6 @@ BraceWrapping: AfterControlStatement: false AfterClass: false AfterNamespace: false - AfterStruct: false AfterUnion: false BeforeElse: true BeforeCatch: true ```
Nerixyz commented 3 months ago

Should've checked #1586.