Add FALLTHROUGH and -Wimplicit-fallthrough to warn about unannotated implicit fallthr...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 03:54:55 +0000 (03:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 03:54:55 +0000 (03:54 +0000)
commit1f0b0bc1d8810af69a0c3c0cc40bdd1955f8e421
treec2c26e332ab0ec4fbabdffa1d75048c5844e607f
parent71d30721841eb66d02c1a08d4fb107217fb3415a
Add FALLTHROUGH and -Wimplicit-fallthrough to warn about unannotated implicit fallthroughs in switches
https://bugs.webkit.org/show_bug.cgi?id=127637

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-01-25
Reviewed by Darin Adler.

For information about [[clang::fallthrough]], see:
<http://clang.llvm.org/docs/LanguageExtensions.html#the-clang-fallthrough-attribute>

* Configurations/Base.xcconfig:
Enable -Wimplicit-fallthrough warnings.

* wtf/Compiler.h:
Define FALLTHROUGH on clang and fallback to outputing nothing when unsupported.

* wtf/dtoa/fast-dtoa.cc:
* wtf/unicode/UTF8.cpp:
(WTF::Unicode::convertLatin1ToUTF8):
(WTF::Unicode::convertUTF16ToUTF8):
(WTF::Unicode::isLegalUTF8):
(WTF::Unicode::readUTF8Sequence):
Explicitly annotate implicit fallthroughs with FALLTHROUGH.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/Configurations/Base.xcconfig
Source/WTF/wtf/Compiler.h
Source/WTF/wtf/dtoa/fast-dtoa.cc
Source/WTF/wtf/unicode/UTF8.cpp