MetaScale/nt2 — Issue #105: Broken or inconsistent `#ifndef` include guards
Author: pyrtsa
Created: 2011-11-10 13:57:42+00:00
State: open

I ran a couple simple tests, and while studying the nt2 source code, found a few spots where the **include guards were outdated or broken**. I wrote a little script that tries to find inconsistencies and suggest better alternatives in a codebase modularized like yours.

To sum up, there were **9 conflicting include guards**, i.e. present in more than one header:

BOOST_DISPATCH_META_PROPERTY_OF_HPP_INCLUDED
BOOST_SIMD_META_ALL_HPP_INCLUDED
BOOST_SIMD_SDK_MEMORY_REPORT_HPP_INCLUDED
BOOST_SIMD_TOOLBOX_BOOLEAN_FUNCTIONS_NEGIF_HPP_INCLUDED
BOOST_SIMD_TOOLBOX_IEEE_FUNCTIONS_SCALAR_SATURATE_HPP_INCLUDED
NT2_SDK_META_ALL_HPP_INCLUDED
NT2_SDK_UNIT_TESTS_HPP_INCLUDED
NT2_TOOLBOX_BOOLEAN_FUNCTIONS_BOOLEAN_SELECT_HPP_INCLUDED
NT2_TOOLBOX_TRIGONOMETRIC_FUNCTIONS_SCALAR_COT_HPP_INCLUDED

Furthermore, there were **14 header files** (plus one `.cmake` file) **with no include guards**. — I don't know if they should have guards or not.

The script also proposes a more **consistent include guard naming scheme**, where a file in `nt2/modules/module-name/include/path/to/file.hpp` should have the form `PATH_TO_FILE_HPP_INCLUDED`. There are a total of 165 files (out of 3123) where the naming scheme is not followed or there is no include guard at all.

The Python script as well as its output are in https://gist.github.com/1354863