Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 22 Feb 2023 12:33:58 +0600
From: NRK <>
Subject: Re: Re: [BUG] ioctl: overflow in implicit constant conversion

On Tue, Feb 21, 2023 at 10:28:42PM +0100, Markus Wichmann wrote:
> Should the compiler not suppress warnings that come from system
> headers?

As far as I see, the warning isn't coming "from system headers". The
header is only defining those constants, the user is the one who's
using that constant in an `int` context.

This isn't much different than the user trying to put `ULONG_MAX` into
an `char` for example. And I don't see how the compiler can "fix" it
unless you introduce some sort of "this constant is OK to be converted
to an int" attribute (which would still require musl having to put the
attribute in from their side).

> Linux itself defines the ioctl syscall to have a second argument of
> type unsigned int.

My local ioctl(2) manpage says it's unsigned _long_ (not `int`).


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.