aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/opcode.h
diff options
authorRamsay Jones <ramsay@ramsayjones.plus.com>2021-09-28 00:45:22 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-05-20 10:55:05 +0200
commitd08822184fe1d4557beca97c2e3599ffc3668e50 (patch)
treefd21e6b95ea88839593466e8c6f4db304f942824 /opcode.h
parent4cd76bd9eeb3777219a307893e33d072df05eb37 (diff)
downloadsparse-dev-d08822184fe1d4557beca97c2e3599ffc3668e50.tar.gz
parse: warn about a 'case label' on empty statement
Commit 0d6bb7e1 ("handle more graciously labels with no statement", 2020-10-26) allowed a label to appear just before the closing brace of a compound statement. This is not valid C (which would require at least a null statement). Similarly, a case label is also not allowed to appear just before a closing brace. So, extend the solution of commit 0d6bb7e1 to issue a warning for case labels and 'insert' a null statement. Note that the next C standard (C23 ?) will allow even more freedom in the placement of labels (see N2508 [1]) and make this placement (along with others) legal C. [1] https://www9.open-std.org/JTC1/SC22/WG14/www/docs/n2508.pdf Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'opcode.h')
0 files changed, 0 insertions, 0 deletions