Skip to content

Fix compilation with -Wtype-limits#1621

Closed
Nerixyz wants to merge 1 commit into
ThePhD:developfrom
Nerixyz:fix/w-type-limits
Closed

Fix compilation with -Wtype-limits#1621
Nerixyz wants to merge 1 commit into
ThePhD:developfrom
Nerixyz:fix/w-type-limits

Conversation

@Nerixyz
Copy link
Copy Markdown

@Nerixyz Nerixyz commented Aug 12, 2024

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 --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
Copy link
Copy Markdown
Author

Nerixyz commented Aug 12, 2024

Should've checked #1586.

@Nerixyz Nerixyz closed this Aug 12, 2024
@Nerixyz Nerixyz deleted the fix/w-type-limits branch August 12, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant