![]() |
![]() |
1516 | ![]() |
||||
![]() | |||||||
| 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. Where a filename differs in case only, some platforms will treat the filenames as distinct. This however will not be portable and on platforms where filenames are not case sensitive, the wrong file may be found causing a compile failure, or worst case the code will continue to build but will have different semantics. Example:
// x.h
struct X
{
};
// bar.h // #1
#include "x.h"
void f(X, int);
// BAR.h // #2
#include "x.h"
// main.cc
#include "bar.h"
void f(X, char);
int main ()
{
X x;
f (x, 1); // Which 'f'
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |