mailing list of musl libc
 help / color / mirror / code / Atom feed
From: NRK <nrk@disroot.org>
To: musl@lists.openwall.com
Subject: Re: [musl] Re: [BUG] ioctl: overflow in implicit constant conversion
Date: Wed, 22 Feb 2023 12:33:58 +0600	[thread overview]
Message-ID: <20230222063358.wyr7rcmryk7hdnyb@gen2.localdomain> (raw)
In-Reply-To: <20230221212842.GG1903@voyager>

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`).

- NRK

  reply	other threads:[~2023-02-22  6:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  5:26 Ralph Little
2023-02-21 16:04 ` Markus Wichmann
2023-02-21 16:42   ` Florian Weimer
2023-02-21 16:53     ` alice
2023-02-21 16:57   ` Jeffrey Walton
2023-02-21 18:25     ` Ralph Little
2023-02-21 21:28     ` Markus Wichmann
2023-02-22  6:33       ` NRK [this message]
2023-02-22  3:17   ` Rich Felker
2023-02-22  4:23     ` Markus Wichmann
2023-02-22 15:53       ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230222063358.wyr7rcmryk7hdnyb@gen2.localdomain \
    --to=nrk@disroot.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).