Skip to content

Commit

Permalink
Fix -Werror=implicit-fallthrough on gcc7
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Lecoeur committed Jun 28, 2017
1 parent 4db21f4 commit f26e83d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fs/vfs/fs_lseek.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence)
{
case SEEK_CUR:
offset += filep->f_pos;

/* FALLTHROUGH */
case SEEK_SET:
if (offset >= 0)
{
Expand Down
5 changes: 2 additions & 3 deletions libc/stdio/lib_dtoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)

case 2:
leftright = 0;
/* no break */
/* FALLTHROUGH */
case 4:
if (ndigits <= 0)
{
Expand All @@ -1205,8 +1205,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)

case 3:
leftright = 0;
/* no break */

/* FALLTHROUGH */
case 5:
i = ndigits + k + 1;
ilim = i;
Expand Down
1 change: 1 addition & 0 deletions libc/stdio/lib_sscanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap)
default:
case 'd':
sign = true;
/* FALLTHROUGH */
case 'u':
base = 10;
break;
Expand Down
4 changes: 4 additions & 0 deletions libc/stdlib/lib_strtod.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ double strtod(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down Expand Up @@ -175,8 +177,10 @@ double strtod(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down
4 changes: 4 additions & 0 deletions libc/stdlib/lib_strtof.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ float strtof(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down Expand Up @@ -177,8 +179,10 @@ float strtof(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down
4 changes: 4 additions & 0 deletions libc/stdlib/lib_strtold.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ long double strtold(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down Expand Up @@ -175,8 +177,10 @@ long double strtold(FAR const char *str, FAR char **endptr)
{
case '-':
negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+':
p++;
/* FALLTHROUGH */
default:
break;
}
Expand Down

0 comments on commit f26e83d

Please sign in to comment.