Skip to content

Fix clang-tidy warnings in executables#7591

Merged
linev merged 3 commits intoroot-project:masterfrom
linev:main_tidy
Mar 19, 2021
Merged

Fix clang-tidy warnings in executables#7591
linev merged 3 commits intoroot-project:masterfrom
linev:main_tidy

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented Mar 18, 2021

Fixes #7527

@linev linev requested a review from pcanal March 18, 2021 14:27
@linev linev self-assigned this Mar 18, 2021
@linev linev requested a review from Axel-Naumann as a code owner March 18, 2021 14:27
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

#ifdef WIN32
#include <process.h>
static string pathsep("\\");
std::string pathsep = "\\";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remote the static keyword? ... humm right it has no practical consequence until the .o file is put in a library.

#ifdef WIN32
#include <process.h>
static string pathsep("\\");
std::string pathsep = "\\";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::string pathsep = "\\";
constexpr const char* pathsep = "\\";

strcpy(name, pwd->pw_gecos);
size_t sz = strlen(pwd->pw_gecos)+1;
char *name = new char [sz];
strlcpy(name, pwd->pw_gecos, sz);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funnily, I find no practical difference between the old and new code ... because sz is anyway th result of strlen ...

Humm ... I guess it would make a difference if the input can be changed between the strlen and the strcpy ...

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@linev linev merged commit 52eed57 into root-project:master Mar 19, 2021
@linev linev deleted the main_tidy branch March 19, 2021 09:26
@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-03-19T10:34:39.424Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1024 (message):

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-03-19T13:40:28.260Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1024 (message):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rootx main] Clang-Tidy Clazy Warnings

3 participants