ltcmelo / psychec

A compiler frontend for the C programming language
BSD 3-Clause "New" or "Revised" License
536 stars 39 forks source link

Switch fall-through unsupported #19

Closed aytey closed 3 years ago

aytey commented 3 years ago

If eligible for the bounty, I wish this to be donated to a local animal charity of the maintainer's choice

GCC version:

gcc (SUSE Linux) 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9]

clang version:

clang version 11.0.1

Output of gcc -Werror -Wall -Wextra -Wpedantic -pedantic -std=c11 -c $FNAME

(return code 0)

Output of clang -Werror -Wall -Wextra -Wpedantic -pedantic -std=c11 -c $FNAME

(return code 0)

Output of cnip $FNAME

uninit-exhaustive-switch-bug.c:5:2 error: `case' label not within a switch statement
  case 1:
  ^

(return code 0)

Content of file

void test(int i) {
  switch (i) {
  case 0:
  case 1:
    break;
  }
}

psychec version

commit 6d7b8249e0f28af105112b217cb33a24f666e148
Author: Leandro T. C. Melo <LTCMELO@GMAIL.COM>
Date:   Tue Feb 23 07:47:25 2021 -0300

    link expression-parsing table in Doxygen documentation
ltcmelo commented 3 years ago

fixed with #22