public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109827] New: Pointer/integer mismatch in ?: not covered by -Wint-conversion
@ 2023-05-12 11:15 fw at gcc dot gnu.org
  2023-05-30 10:51 ` [Bug c/109827] " egallager at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fw at gcc dot gnu.org @ 2023-05-12 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109827

            Bug ID: 109827
           Summary: Pointer/integer mismatch in ?: not covered by
                    -Wint-conversion
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fw at gcc dot gnu.org
  Target Milestone: ---

This:

int p;
long *q;

void *
f1 (int x)
{
  return x ? p : q;
}

void *
f2 (int x)
{
  return x ? q : p;
}

warns as (twice):

warning: pointer/integer type mismatch in conditional expression

So it does not error with -Werror=int-conversion, which I think is unexpected.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-20 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 11:15 [Bug c/109827] New: Pointer/integer mismatch in ?: not covered by -Wint-conversion fw at gcc dot gnu.org
2023-05-30 10:51 ` [Bug c/109827] " egallager at gcc dot gnu.org
2023-10-20  7:56 ` fw at gcc dot gnu.org
2023-10-20 20:16 ` cvs-commit at gcc dot gnu.org
2023-10-20 20:20 ` fw at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).