[Doxygen-develop] undocumented return type warning
Brought to you by:
dimitri
From: Robbie G. <ro...@m8...> - 2006-10-19 08:18:00
|
Hi All, Thanks for a very useful tool! I was a little confused about why i didn't seem to be getting warnings about failing to give @return directives. I took a look at the code, and unless i'm mistaken the tests around line 449 in docparser.cpp have the wrong sense - i.e. they ignore missing @return for nonconstructors and nondestructors rather than constructors and destructors. Reversing the sense seems to give warnings as expected. Unfortunately, one also gets warnings for non function members. This can be fixed by checking memberType() before issuing the warning near line 2285 in src/memberdef.cpp, but maybe there is a more appropriate fix ? I'm using doxygen-1.5.0 compiled from source on win32. - robbie src/docparser.cpp @@ -449,8 +449,8 @@ g_memberDef->hasDocumentedReturnType() || returnType.isEmpty() || // empty return type returnType.find("void")!=-1 || // void return type - !g_memberDef->isConstructor() || // a constructor - !g_memberDef->isDestructor() // or destructor + g_memberDef->isConstructor() || // a constructor + g_memberDef->isDestructor() // or destructor ) { g_memberDef->setHasDocumentedReturnType(TRUE); src/memberdef.cpp @@ -2285,7 +2285,7 @@ "Warning: parameters of member %s are not (all) documented", qualifiedName().data()); } - if (!hasDocumentedReturnType()) + if (!hasDocumentedReturnType() && (MemberDef::Function == memberType())) { warn_doc_error(docFile(),docLine(), "Warning: return type of member %s is not documented", |