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

Fix more C++ lints in cpp #3275

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Conversation

bernardnormier
Copy link
Member

These lints were fixed "by hand".

Copy link
Member

@externl externl left a 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
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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.
Copy link
Member

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?

Copy link
Member Author

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.

@bernardnormier bernardnormier merged commit 3b28f7a into zeroc-ice:main Dec 17, 2024
19 checks passed
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
@bernardnormier bernardnormier deleted the tidy3 branch January 21, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants