xiph / vorbis

Reference implementation of the Ogg Vorbis audio format.
BSD 3-Clause "New" or "Revised" License
467 stars 188 forks source link

Make it fallthrough explicit #33

Closed agx closed 5 years ago

agx commented 6 years ago

This suppresses

codebook.c: In function ‘vorbis_book_decodev_add’:
codebook.c:417:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
           a[i++]+=t[j++];

warnings with gcc7.

penguin359 commented 6 years ago

GCC now has an attribute to explicitly declare fall-throughs in code. The case label can be prefixed with __attribute__((fallthrough)); to avoid these warnings.

erikd commented 6 years ago

👍

agx commented 6 years ago

@penguin359 I know but the comments make it explicit and don't confuse other compilers not supporting attribute fallthrough.

tdaede commented 5 years ago

We dropped these duff devices entirely.