Skip to content

Commit

Permalink
Detection of missing / superfluous \n in warnings
Browse files Browse the repository at this point in the history
In PR #10135 most of the problems were already solved.
There was sill an extra empty line that is now removed as well.
(`warn_simple` was only used at 1 place and is now also replaced by the standard `warn` routine).
  • Loading branch information
albert-github committed Jun 29, 2023
1 parent 3966883 commit 0c08645
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/doxygen.cpp
Expand Up @@ -5892,11 +5892,10 @@ static void addMemberFunction(const Entry *root,

warnMsg+=" ";
warnMsg+=fullFuncDecl;
warnMsg+='\n';

if (candidates>0 || noMatchCount>=1)
{
warnMsg+="Possible candidates:\n";
warnMsg+="\nPossible candidates:";

NamespaceDef *nd=0;
if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName);
Expand All @@ -5913,6 +5912,7 @@ static void addMemberFunction(const Entry *root,
}
if (cd!=0 && (rightScopeMatch(cd->name(),className) || (cd!=tcd)))
{
warnMsg+='\n';
const ArgumentList &templAl = md->templateArguments();
warnMsg+=" '";
if (templAl.hasParameters())
Expand All @@ -5932,11 +5932,10 @@ static void addMemberFunction(const Entry *root,
warnMsg+=qScope+"::"+md->name();
warnMsg+=md->argsString();
warnMsg+="' " + warn_line(md->getDefFileName(),md->getDefLine());
warnMsg+='\n';
}
}
}
warn_simple(root->fileName,root->startLine,qPrint(warnMsg));
warn(root->fileName,root->startLine,"%s",qPrint(warnMsg));
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/message.cpp
Expand Up @@ -220,12 +220,6 @@ void va_warn(const QCString &file,int line,const char *fmt,va_list args)
do_warn(Config_getBool(WARNINGS), file, line, g_warningStr, fmt, args);
}

void warn_simple(const QCString &file,int line,const char *text)
{
if (!Config_getBool(WARNINGS)) return; // warning type disabled
format_warn(file,line,QCString(g_warningStr) + text);
}

void warn_undoc_(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
Expand Down
1 change: 0 additions & 1 deletion src/message.h
Expand Up @@ -28,7 +28,6 @@
extern void msg(const char *fmt, ...) PRINTFLIKE(1,2);
extern void warn_(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
extern void va_warn(const QCString &file, int line, const char* fmt, va_list args);
extern void warn_simple(const QCString &file,int line,const char *text);
extern void warn_undoc_(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
extern void warn_incomplete_doc_(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
extern void warn_doc_error_(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
Expand Down

0 comments on commit 0c08645

Please sign in to comment.