Skip to content

Commit

Permalink
Suppress warnings for implicit fallthrough by parsing comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfivet committed Nov 26, 2019
1 parent e71338b commit 556ed8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ uname_S := $(shell sh -c 'echo $(uname_S) | sed s/_.*$$//')
PROGRAM=ue

CC=gcc
WARNINGS=-pedantic -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter
WARNINGS=-pedantic -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter -Wimplicit-fallthrough=2
CFLAGS=-O2 $(WARNINGS)
#CC=c89 +O3 # HP
#CFLAGS= -D_HPUX_SOURCE -DSYSV
Expand Down Expand Up @@ -130,7 +130,7 @@ depend: ${SRC}
$(Q) ${CC} ${CFLAGS} ${DEFINES} -c $*.c

# DO NOT DELETE THIS LINE -- make depend uses it
# Updated Tue, Aug 13, 2019 7:51:49 AM
# Updated Mon Nov 25 12:50:00 CST 2019

basic.o: basic.c basic.h retcode.h input.h bind.h mlout.h random.h \
terminal.h defines.h utf8.h window.h buffer.h line.h
Expand Down
1 change: 1 addition & 0 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ static int dobuf(struct buffer *bp)
}
/* drop down and act just like !BREAK */

/* fallthrough */
case DBREAK: /* BREAK directive */
if (dirnum == DBREAK && execlevel)
goto onward;
Expand Down
2 changes: 2 additions & 0 deletions execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ int execute( int c, int f, int n) {

break ;
}

/* fallthrough */
default:
status = linsert( n, c) ;
}
Expand Down
2 changes: 1 addition & 1 deletion search.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ static int cclmake(char **ppatptr, struct magic *mcptr)
*/
case MC_ESC:
pchr = *++patptr;
/* falltrhough */
/* fallthrough */
default:
setbit(pchr, bmap);
break;
Expand Down

0 comments on commit 556ed8d

Please sign in to comment.