MantisBT - CMake
View Issue Details
0011681CMakeDevelopmentpublic2011-01-11 07:122011-01-11 09:07
Markus Elfring 
Brad King 
normalmajoralways
closedno change required 
CMake 2.8.3 
 
0011681: Check return codes everywhere
Some checks for return codes are missing.

Examples:
Would you like to add more error handling for return values from "fseek" like in the member function "SystemTools::FileHasSignature" and from "fprintf" in the function "cmCoreTryCompile::TryCompileCode"?
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/SystemTools.cxx;hb=6754b26bf0bb69ad6d65249bf4122dbbda446922#l3566 [^]
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmCoreTryCompile.cxx;hb=72ebd4ee12fc99b5302c18619f120bd9c285b474#l172 [^]
No tags attached.
Issue History
2011-01-11 07:12Markus ElfringNew Issue
2011-01-11 07:50Markus ElfringNote Added: 0024572
2011-01-11 09:07Brad KingNote Added: 0024577
2011-01-11 09:07Brad KingStatusnew => closed
2011-01-11 09:07Brad KingAssigned To => Brad King
2011-01-11 09:07Brad KingResolutionopen => no change required

Notes
(0024572)
Markus Elfring   
2011-01-11 07:50   
I suggest to avoid unchecked function calls.
Would you like to detect every error situation as early as possible?

I guess that further code reviews will be needed for potential issues from unused return values like it happens with calls for the functions "read" and "write" in your function "kwsysProcessesSignalHandler".
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/ProcessUNIX.c;hb=b9e3c243d476efa04479d253cfc4f76ecbdb6fe3#l2713 [^]
(0024577)
Brad King   
2011-01-11 09:07   
The issue tracker is not a good place to perform code review. Every real-world project has plenty of places that the code can be improved. Yes, there are cases where subtle failures can occur in obscure cases. Most will probably go unfixed until they cause a specific problem in practice, or a volunteer steps forward with ***actual patches to contribute***.

See also 0011683:0024576.