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.

Reply via email to