Skip to content

Fix sign-conversion warnings with musl ioctl#22

Closed
yktyagi wants to merge 1 commit intointel:masterfrom
yktyagi:fix-musl-ioctl-sign-conversion
Closed

Fix sign-conversion warnings with musl ioctl#22
yktyagi wants to merge 1 commit intointel:masterfrom
yktyagi:fix-musl-ioctl-sign-conversion

Conversation

@yktyagi
Copy link

@yktyagi yktyagi commented Feb 5, 2026

musl's ioctl request macros (_IOC) expand to unsigned long values, causing sign-conversion warnings when passed to ioctl() which expects an int as the request parameter.

This issue occurs when building with -Werror -Wsign-conversion flags on musl-based systems, causing compilation failures.

Cast the IOCTL_MEI_* macros explicitly to int in three locations:

  • IOCTL_MEI_CONNECT_CLIENT in __mei_connect()
  • IOCTL_MEI_CONNECT_CLIENT_VTAG in __mei_connect_vtag()
  • IOCTL_MEI_NOTIFY_GET in __mei_notify_get()

This maintains compatibility with both glibc (where _IOC expands to int) and musl (where it expands to unsigned long).

musl's ioctl request macros (_IOC) expand to unsigned long values,
causing sign-conversion warnings when passed to ioctl() which expects
an int as the request parameter.

This issue occurs when building with -Werror -Wsign-conversion flags
on musl-based systems, causing compilation failures.

Cast the IOCTL_MEI_* macros explicitly to int in three locations:
- IOCTL_MEI_CONNECT_CLIENT in __mei_connect()
- IOCTL_MEI_CONNECT_CLIENT_VTAG in __mei_connect_vtag()
- IOCTL_MEI_NOTIFY_GET in __mei_notify_get()

This maintains compatibility with both glibc (where _IOC expands to int)
and musl (where it expands to unsigned long).

Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
@yktyagi yktyagi closed this Feb 11, 2026
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