Skip to content

suppress warning from unreachable over-shift#325

Merged
Smattr merged 1 commit into
mainfrom
smattr/9f6015fd-a774-4857-a083-df066ed4137a
May 14, 2026
Merged

suppress warning from unreachable over-shift#325
Smattr merged 1 commit into
mainfrom
smattr/9f6015fd-a774-4857-a083-df066ed4137a

Conversation

@Smattr
Copy link
Copy Markdown
Owner

@Smattr Smattr commented May 14, 2026

When debugging is enabled and the state is of non-trivial size, GCC complains about this code:

  In file included from foo.c:7:
  foo.c: In function ‘set_insert’:
  foo.c:3802:40: warning: left shift count >= width of type
    [-Wshift-count-overflow]
   3802 |           assert(*count <= ((size_t)1) << STATE_SIZE_BITS &&
        |                                        ^~

Reported-by: GCC 15.2.1 -Wshift-count-overflow

When debugging is enabled and the state is of non-trivial size, GCC
complains about this code:

  In file included from foo.c:7:
  foo.c: In function ‘set_insert’:
  foo.c:3802:40: warning: left shift count >= width of type
    [-Wshift-count-overflow]
   3802 |           assert(*count <= ((size_t)1) << STATE_SIZE_BITS &&
        |                                        ^~

Reported-by: GCC 15.2.1 -Wshift-count-overflow
@Smattr Smattr merged commit 11347fc into main May 14, 2026
22 checks passed
@Smattr Smattr deleted the smattr/9f6015fd-a774-4857-a083-df066ed4137a branch May 14, 2026 13:33
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