Skip to content

-Wsign-conversion#3681

Closed
Earlopain wants to merge 1 commit into
ruby:mainfrom
Earlopain:wsign-errors
Closed

-Wsign-conversion#3681
Earlopain wants to merge 1 commit into
ruby:mainfrom
Earlopain:wsign-errors

Conversation

@Earlopain

Copy link
Copy Markdown
Collaborator

selenium-webdriver pinned prism to 1.4.0 because of the following warning (which their compiler treats as an error):

src/prism.c: In function ‘context_terminator’:
src/prism.c:8651:62: error: conversion to ‘unsigned int’ from ‘int’ may change
the sign of the result [-Werror=sign-conversion]
8651 |     return token->type < 32 && (context_terminators[context] & (1 <<
token->type));

I have seen this warning myself during building, but now I can't reproduce anymore. Perhaps CI will tell me more.

@Earlopain
Earlopain marked this pull request as draft October 15, 2025 12:50
@froydnj

froydnj commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

You almost certainly need to cast the 1 to unsigned prior to the shift.

@Earlopain

Copy link
Copy Markdown
Collaborator Author

Oh, I see that -Wconversion is already enabled (which I think includes -Wsign-conversion) 🤷. I can't remember what I did to get this warning myself to confirm anything

@kddnewton

Copy link
Copy Markdown
Collaborator

I think this is now solved by #3682

@Earlopain

Copy link
Copy Markdown
Collaborator Author

Yeah, probably.

@Earlopain Earlopain closed this Oct 16, 2025
@Earlopain
Earlopain deleted the wsign-errors branch December 3, 2025 07:37
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.

3 participants