Skip to content

ext/session: Fix implicit conversion warning#21216

Open
arshidkv12 wants to merge 3 commits intophp:masterfrom
arshidkv12:session-3
Open

ext/session: Fix implicit conversion warning#21216
arshidkv12 wants to merge 3 commits intophp:masterfrom
arshidkv12:session-3

Conversation

@arshidkv12
Copy link
Contributor

Fix -Wconversion warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you change n type, it needs to reflect here

ZVAL_NULL(retval);
}
PS(in_save_handler) = false;
for (i = 0; i < argc; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then there is type mismatch with i

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these compiler flags, but no warnings are being shown.

CC = cc
CFLAGS = -Wconversion -O0
CFLAGS_CLEAN = $(CFLAGS) -D_GNU_SOURCE
CPP = cc -E
CPPFLAGS = -DHAVE_CONFIG_H

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure. all I m saying is there is a signedness mismatch.


if (n != ZSTR_LEN(val)) {
if (n == (size_t)-1) {
if (n == (ssize_t)-1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless cast. ssize_t is signed.

@devnexen
Copy link
Member

devnexen commented Feb 15, 2026

Let's give it a rest ... This kind of little changes, usually, deserve to be within larger refactoring but I ll leave it to @Girgias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants