-
Notifications
You must be signed in to change notification settings - Fork 593
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
Fix more C++ lints in cpp #3275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@@ -259,8 +259,8 @@ namespace Ice | |||
|
|||
// The copy constructor and assignment operators are to keep GCC happy. | |||
Proxy(const Proxy&) noexcept = default; | |||
Proxy& operator=(const Proxy&) noexcept { return *this; } | |||
Proxy& operator=(Proxy&&) noexcept { return *this; } | |||
Proxy& operator=(const Proxy&) noexcept { return *this; } // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include the lint name like we're doing in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are dummy functions to keep GCC happy. Here, clang-tidy is complaining about not testing for self-assignment, which is irrelevant.
@@ -107,9 +107,11 @@ namespace | |||
{ | |||
#if defined(__APPLE__) || defined(_WIN32) | |||
|
|||
// NOLINTBEGIN:cert-err58-cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just get rid of the constants? They're only used in this function. and we make a copy all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. In simple cases like these, we should use const char* const
@@ -15,7 +15,7 @@ | |||
// For UINTPTR_MAX on Ubuntu Precise | |||
// | |||
#ifndef __STDC_LIMIT_MACROS | |||
# define __STDC_LIMIT_MACROS | |||
# define __STDC_LIMIT_MACROS // NOLINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. What doesn't the linter like here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't like that we define a __XXX symbol.
@@ -11,7 +11,8 @@ | |||
#include "SessionI.h" | |||
#include "TopicI.h" | |||
|
|||
namespace std | |||
// TODO: explain why we need to use namespace std here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is for ADL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but it's not immediately clear to me.
These lints were fixed "by hand".