[webkit-dev] Proposal for coding guidelines: Do not use fall-through switch cases inside #ifdef's

Bruno Abinader brunoabinader at gmail.com
Fri Aug 17 11:57:32 PDT 2012


On Fri, Aug 17, 2012 at 2:24 PM, Joe Mason <jmason at rim.com> wrote:
> What do you mean by "precompiler"?  The preprocessor?  Or is this a precompiled headers thing?

Indeed, s/precompiler/preprocessor :)

>
> Are you sure there wasn't a typo in the "case CSSPropertyWebkitTextDecorationLine:" line which caused a perfectly normal syntax error when CSS3_TEXT_DECORATION was defined?  Or maybe CSSPropertyWebkitTextDecorationLine was not defined?

There is no typo as far as I've checked. The following was added to
Source/WebCore/css/CSSPropertyNames.in:

...
#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
-webkit-text-decoration-line
#endif
...

> I dislike this.  Repeated code should be avoided. Fallthrough is a widely used and accepted technique to do that, ever since the days of C. I can't believe there's a compiler that doesn't handle this correctly.

+1 on that. I've re-checked the build bot output and it seems the
issue is actually caused because CSSPropertyWebkitTextDecorationLine
gets undefined. So I'm starting to believe the fail reason is
something else skipping from my eyes. The actual bug related to this
issue is https://bugs.webkit.org/show_bug.cgi?id=94108 .

>
>> Where each switch case is handled individually (if you're curious
>> about it, it is fixed in bug 90493). Said this, I would like to
>
> https://bugs.webkit.org/show_bug.cgi?id=90493 is "[chromium] Don't archive build files generated by VS2010", and doesn't seem to be related.

My bad :/ The right bug is 94093:
https://bugs.webkit.org/show_bug.cgi?id=94093 .

-- 
Bruno de Oliveira Abinader


More information about the webkit-dev mailing list