Changes between Version 13 and Version 14 of Commentary/CodingStyle


Ignore:
Timestamp:
Sep 4, 2007 7:56:30 AM (7 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/CodingStyle

    v13 v14  
    11 
     2[[PageOutline]] 
    23 
    34 = The GHC Commentary - Coding Style Guidelines for the compiler =  
     
    67 
    78The general rule is to stick to the same coding style as is already used in the file you're editing. If you must make stylistic changes, commit them separately from functional changes, so that someone looking back through the change logs can easily distinguish them.  
     9 
     10== Warnings == 
     11 
     12We are aiming to make the GHC code warning-free for all warnings turned on by 
     13{{{ 
     14-Wall -fno-warn-name-shadowing 
     15}}} 
     16and as such the build sets these flags for the stage 2 compiler, and the validate script, which is used to test the build before commiting, additionally sets the `-Werror` flag. As the `-Werror` flag is not set during normal builds, during development warnings will be printed but won't halt the build. 
     17 
     18Currently we are some way from our goal, so many modules have a 
     19{{{ 
     20{-# OPTIONS -w #-} 
     21}}} 
     22pragma; you are encouraged to remove this pragma and fix any warnings when working on a module. 
    823 
    924== General Style == 
     
    134149If the module can be compiled multiple ways (eg. GHCI vs. non-GHCI), make sure the imports are properly `#ifdefed` too, so as to avoid spurious unused import warnings.  
    135150 
    136 == Warnings == 
    137  
    138 We are aiming to make the GHC code warning-free for all warnings turned on by 
    139 {{{ 
    140 -Wall -fno-warn-name-shadowing 
    141 }}} 
    142 and as such the build sets these flags for the stage 2 compiler, and the validate script, which is used to test the build before commiting, additionally sets the `-Werror` flag. As the `-Werror` flag is not set during normal builds, during development warnings will be printed but won't halt the build. 
    143  
    144 Currently we are some way from our goal, so many modules have a 
    145 {{{ 
    146 {-# OPTIONS -w #-} 
    147 }}} 
    148 pragma; you are encouraged to remove this pragma and fix any warnings when working on a module.