pydata / bottleneck

Fast NumPy array functions written in C
BSD 2-Clause "Simplified" License
1.08k stars 104 forks source link

Implicit fallthroughs prevent compiler warning enablement #455

Open r-barnes opened 5 months ago

r-barnes commented 5 months ago

Describe the bug There are a number of places like this where the code does an implicit fallthrough.

Could these please be marked with __attribute__((fallthrough)) (for C code) or [[fallthrough]] (for C++17 and above code)? That enables the use of -Wimplicit-fallthrough which requires that all fallthroughs be explicit, reducing potential error surfaces.

To Reproduce To assist in reproducing the bug, please include the following:

  1. Command/code being executed: N/A
  2. Python version and OS: N/A
  3. pip version: master
  4. Output of pip list or conda list: N/A

Expected behavior Fallthroughs are marked explicitly.

Additional context Add any other context about the problem here.

rdbisme commented 2 months ago

Hello @r-barnes, thanks.

Wanna give it a go with a contribution? :)