![]() |
![]() |
1515 | ![]() |
||||
![]() | |||||||
| 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. Further more, in this instance two files have the same exact name and so if the '-I' option is changed, its possible that the source will no longer build, or worst case will build but have silent semantic changes. 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 |