[Webkit-unassigned] [Bug 124849] New: check-webkit-style should check for misplaced primary header inside ENABLE(FEATURE)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 25 11:27:51 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=124849

           Summary: check-webkit-style should check for misplaced primary
                    header inside ENABLE(FEATURE)
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: burg at cs.washington.edu


I believe the house style for feature guards is that:

1. Feature-specific headers should contain ENABLE(FEATURE) to wrap most or all of the header, starting after the File_h ifdef and before secondary includes. Conceptually, the header shouldn't define things that are not implemented if the feature is not enabled.

2. Feature-specific implementation files should place the primary header immediately below #include "config.h" and before the ENABLE(FEATURE) ifdef.

And check-webkit-style does not check either. These style rules are not on http://www.webkit.org/coding/coding-style.html but are fairly consistent in newer code.

Header file:

... copyright block ...
#ifndef Feature_h
#define Feature_h

#if ENABLE(FEATURE)

... header includes, namespace, definitions, ...

#endif // ENABLE(FEATURE)

#endif // Feature_h


Implementation file:

#include "config.h"
#include "Feature.h"

#if ENABLE(FEATURE)

... secondary headers ...

#endif // ENABLE(FEATURE)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list