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

            Bug ID: 122796
           Summary: assert and fallthrough
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: peter at eisentraut dot org
  Target Milestone: ---

I would have expected this to produce a -Wimplicit-fallthrough warning, but it
does not:

```
#include <assert.h>

int foo(int a, void *p)
{
    int b = 0;

    switch (a)
    {
    case 0:
            assert(p != 0);
            // no warning here
    case 1:
            b = 11;
            break;
    }

    return b;
}
```

Curiously, it does produce the warning if I replace the assert() with its
preprocessed equivalent.  Is there something magic about assert() here?  Still,
doesn't seem right.

Reply via email to