mailing list of musl libc
 help / color / mirror / code / Atom feed
From: James Y Knight <jyknight@google.com>
To: musl@lists.openwall.com
Cc: Denis Ovsienko <denis@ovsienko.info>
Subject: Re: [musl] musl CMSG_NXTHDR() triggers a -Wsign-compare from Clang
Date: Mon, 1 Apr 2024 11:39:29 -0400	[thread overview]
Message-ID: <CAA2zVHoBgBhOhKKZJDoKHPpGzF2FxQPG4UWsMoHxKyQ01vMDcg@mail.gmail.com> (raw)
In-Reply-To: <20240330020614.GN4163@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

On Fri, Mar 29, 2024 at 10:08 PM Rich Felker <dalias@libc.org> wrote:

> It's not clear to me why clang
> (ang gcc?) fail to suppress this as coming from -isystem. Clearly they
> now where the macro was expanded from; it's even in the above message.
>
>
Clang and GCC suppress diagnostics in system headers, but as a general
rule, do not suppress diagnostics arising from expanding macros which were
defined in system headers. There are special cases for some diagnostics,
but this is not one of them in Clang.

As an example with a different diagnostic, the following triggers
-Wincompatible-pointer-types for the definition of "z", but not "y", in
both GCC and Clang:

// System header "test.h"
int yy;
float *y = &yy;
#define FOO float *z = &yy;

// User file "test.c"
#include <test.h>
FOO

If there's no path forward on getting compilers not to do this, maybe
> we should look into working around the warning this one time? :/


 Inserting an explicit cast in the musl macro would seem appropriate here.

[-- Attachment #2: Type: text/html, Size: 1675 bytes --]

      reply	other threads:[~2024-04-01 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 16:50 Denis Ovsienko
2024-03-30  2:06 ` Rich Felker
2024-04-01 15:39   ` James Y Knight [this message]

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=CAA2zVHoBgBhOhKKZJDoKHPpGzF2FxQPG4UWsMoHxKyQ01vMDcg@mail.gmail.com \
    --to=jyknight@google.com \
    --cc=denis@ovsienko.info \
    --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).