Skip to content

Comment the intentional fallthrough#13

Merged
typester merged 1 commit intotypester:masterfrom
skaji:fallthrough
Aug 2, 2018
Merged

Comment the intentional fallthrough#13
typester merged 1 commit intotypester:masterfrom
skaji:fallthrough

Conversation

@skaji
Copy link
Contributor

@skaji skaji commented Jul 5, 2018

Fix #11

Currently Data-MessagePack-Stream cannot be built on ubuntu 18.04 (which has gcc 7.3.0):

❯ gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0

❯ perl Makefile.PL
...
❯ make
...
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I../include -O3 -Wall -Wextra -Werror  -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c -o unpack.lo unpack.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../include -O3 -Wall -Wextra -Werror -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c unpack.c  -fPIC -DPIC -o unpack.o
In file included from unpack.c:268:0:
../include/msgpack/unpack_template.h: In function ‘template_execute’:
../include/msgpack/unpack_template.h:250:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
                 ++p;
                 ^~~
../include/msgpack/unpack_template.h:252:13: note: here
             default:
             ^~~~~~~
cc1: all warnings being treated as errors

This PR fixes this problem by the same change of msgpack/msgpack-c#586

@typester typester self-requested a review July 9, 2018 03:39
Copy link
Owner

@typester typester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I didn't know that recent gcc had such a funny warnings though

@typester typester requested a review from syohex July 9, 2018 03:41
@typester
Copy link
Owner

typester commented Jul 9, 2018

I think we should review #12 too. If @syohex has no time for that, I will do.

@typester typester merged commit 8c65dff into typester:master Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Wimplicit-fallthrough in gcc7

2 participants