Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ldlogger] Fix warnings #3305

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions analyzer/tools/build-logger/src/ldlogger-tool-gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int isObjectFile(const char* filename_)
*/
char* getResponseFile(const LoggerVector* arguments_)
{
int i;
size_t i;

for (i = 0; i < arguments_->size; ++i)
{
Expand Down Expand Up @@ -546,7 +546,7 @@ int loggerGccParserCollectActions(
{
loggerVectorAdd(actions_, action);
}
else if (responseFile = getResponseFile(&action->arguments))
else if ((responseFile = getResponseFile(&action->arguments)))
{
LOG_INFO("Processing response file: %s", responseFile);
loggerVectorAdd(&action->sources, responseFile);
Expand Down
14 changes: 7 additions & 7 deletions analyzer/tools/build-logger/src/ldlogger-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ static void getCurrentTime(char* buff_)
timeinfo = localtime(&rawtime);

strftime(buff_, 26, "%Y-%m-%d %H:%M:%S", timeinfo);

return buff_;
}

// FIXME: Deprecated. Use the predictEscapedSizeFixed instead.
Expand Down Expand Up @@ -600,7 +598,7 @@ void freeLock(int lockFile_)
}
}

void logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)
int logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)
{
const char* debugFile = getenv("CC_LOGGER_DEBUG_FILE");
if (!debugFile)
Expand Down Expand Up @@ -640,7 +638,7 @@ void logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)
line_);

char* p, *str, **items;
int num;
size_t num;
size_t i;

va_list args;
Expand All @@ -657,7 +655,7 @@ void logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)
{
case 'a':
{
num = va_arg(args, int);
num = va_arg(args, size_t);
items = va_arg(args, char**);
for (i = 0; i < num; ++i)
{
Expand All @@ -673,8 +671,8 @@ void logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)
}
case 'd':
{
num = va_arg(args, int);
fprintf(stream, "%d", num);
num = va_arg(args, size_t);
fprintf(stream, "%zu", num);
continue;
}
default:
Expand All @@ -690,4 +688,6 @@ void logPrint(char* logLevel_, char* fileName_, int line_, char *fmt_,...)

fclose(stream);
freeLock(lockFd);

return 0;
}
2 changes: 1 addition & 1 deletion analyzer/tools/build-logger/src/ldlogger-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,6 @@ void freeLock(int lockFile_);
* These formatted tags will be replaced by the values specified in
* subsequent additional arguments and formatted as requested.
*/
void logPrint(char* logLevel_, char* fileName_, int line_, char* fmt_, ...);
int logPrint(char* logLevel_, char* fileName_, int line_, char* fmt_, ...);

#endif /* __LOGGER_UTIL_H__ */