[previous] 1517 [next] Different files are being used which have the same filename 'filename', and one includes the other.
CMA maintenance checks

As with type, object and function names, the name used for a file should also help document the purpose of that file.

If two files in a project share the same name it may be that the names are not descriptive enough leading to extra maintenance effort.

There is one situation where using the same identical filename may have been intentional. This is in the case of forwarding headers, where an extra header file exists in a 'public' directory.

Example:


// impl/x.h
struct X
{
};

// include/x.h
#include "../impl/x.h"


// main.cc
#include "x.h"            // finds impl/x.h via include/x.h

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents