lordgamez commented on code in PR #1330:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1330#discussion_r872087728


##########
thirdparty/rapidjson-48fbd8cd202ca54031fe799db2ad44ffa8e77c13/include/rapidjson/document.h:
##########
@@ -1236,7 +1236,7 @@ class GenericValue {
 
             // Use static buffer and placement-new to prevent destruction
             static char buffer[sizeof(GenericValue)];
-            return *new (buffer) GenericValue();
+            return *new (buffer) GenericValue();  // 
NOLINT(clang-analyzer-cplusplus.PlacementNew)

Review Comment:
   Rapidjson is set to be a system include so it should be exluded by 
clang-tidy. It does work for every other thirdparty, but somehow when a file 
uses this inlude clang-tidy still throws a warning about this. Unfortunately I 
could not find another way of excluding it and it may be due to a clang-tidy-14 
bug because when I checked the same files that had this error with 
clang-tidy-10 I did not get any warnings.



##########
libminifi/test/unit/SocketTests.cpp:
##########
@@ -190,7 +190,7 @@ TEST_CASE("TestTLSContextCreation", "[TestSocket8]") {
     std::function<bool()> f_ex = createSocket;
     utils::Worker<bool> functor(f_ex, "id");
     std::future<bool> fut;
-    pool.execute(std::move(functor), fut);
+    pool.execute(std::move(functor), fut);  // NOLINT(bugprone-use-after-move)

Review Comment:
   I don't know either why it gives a warning, it seems okay to me too. I 
suspected that maybe the TEST_CASE macro does something I'm not aware of, but 
as it looked okay I only put the NOLINT comment there.



##########
extensions/procfs/CpuStat.h:
##########
@@ -34,7 +34,12 @@ class CpuStatData {
  public:
   static std::optional<CpuStatData> parseCpuStatLine(std::istream& iss);
 
-  auto operator<=>(const CpuStatData& rhs) const = default;
+  bool operator<=(const CpuStatData& rhs) const;
+  bool operator>(const CpuStatData& rhs) const;
+  bool operator>=(const CpuStatData& rhs) const;
+  bool operator<(const CpuStatData& rhs) const;
+  bool operator==(const CpuStatData& rhs) const;
+  bool operator!=(const CpuStatData& rhs) const;

Review Comment:
   Clang compilation failed with a warning on the spaceship operator in this 
particular case.
   ```
   
/home/ggyimesi/projects/nifi-minifi-cpp-fork/extensions/procfs/CpuStat.h:37:8: 
error: explicitly defaulted three-way comparison operator is implicitly deleted 
[-Werror,-Wdefaulted-function-deleted]
     auto operator<=>(const CpuStatData& rhs) const = default;
          ^
   
/home/ggyimesi/projects/nifi-minifi-cpp-fork/extensions/procfs/CpuStat.h:57:23: 
note: defaulted 'operator<=>' is implicitly deleted because there is no viable 
comparison function for member 'user_'
     SystemClockDuration user_;
   ```
   
   I'm not sure why it can't use it with the SystemClockDuration type.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to