Skip to content

Commit

Permalink
Add param validation to typedef function pointers
Browse files Browse the repository at this point in the history
Currently typedef'd function pointers, typically used as callbacks,
don't have their `@param` documentation properly validated. This commit
adds a proper check by initializing their memberdef with the parsed
args. To avoid duplicating the params in the output, since typedef's
already have the params in their definition, an extra check was added.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
  • Loading branch information
utzig committed Dec 17, 2020
1 parent 736557c commit d34236b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ static MemberDef *addVariableToFile(
type,name,args,0,
root->protection, Normal,root->stat,Member,
mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
ArgumentList(), root->metaData) };
root->argList, root->metaData) };
md->setTagInfo(root->tagInfo());
md->setMemberSpecifiers(root->spec);
md->setDocumentation(root->doc,root->docFile,root->docLine);
Expand Down
2 changes: 1 addition & 1 deletion src/memberdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
md->argumentList() : md->declArgumentList();
//printf("writeDefArgumentList '%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition());
if (!defArgList.hasParameters() || md->isProperty())
if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef())
{
return FALSE; // member has no function like argument list
}
Expand Down

0 comments on commit d34236b

Please sign in to comment.