Skip to content

fix: Resolve compiler warnings in Net, Zip, and Foundation modules#5092

Merged
matejk merged 2 commits intomainfrom
fix-compiler-warnings
Dec 17, 2025
Merged

fix: Resolve compiler warnings in Net, Zip, and Foundation modules#5092
matejk merged 2 commits intomainfrom
fix-compiler-warnings

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Dec 16, 2025

Summary

This PR fixes compiler warnings reported by modern C++ compilers (GCC 11+, Clang 15+):

Net module

  • PollSet.cpp: Added (void) casts to suppress -Wunused-result warnings for read() and write() calls where return values are intentionally ignored (as documented in comments)
  • RemoteSyslogListener.cpp: Fixed -Wdeprecated-enum-enum-conversion by casting enum values to int before arithmetic operations between Facility and Severity enums
  • WebSocket.cpp: Fixed -Wdeprecated-enum-enum-conversion by casting FrameFlags and FrameOpcodes enum values to int before bitwise OR operation

Zip module

  • ZipArchiveInfo.cpp, ZipDataInfo.cpp, ZipFileInfo.cpp, ZipLocalFileHeader.cpp, ZipUtil.cpp: Fixed -Wdeprecated-anon-enum-enum-conversion by casting anonymous enum values to std::size_t or std::streamsize when performing arithmetic with ZipCommon::HEADER_SIZE

Foundation module

  • RWLockTest.cpp: Modernized to use std::atomic<int> (C++11) instead of deprecated volatile int with complex #ifdef __cpp_lib_atomic_ref fallback. This eliminates -Wdeprecated-volatile warnings while maintaining thread-safe semantics

CI

  • Added macos-clang-cmake-warnings job to detect compiler warnings in future builds

Warning Types Fixed

Warning Count Description
-Wunused-result 24 Ignoring return value of functions with warn_unused_result attribute
-Wdeprecated-enum-enum-conversion 134 Arithmetic/bitwise operations between different enum types (C++20 deprecation)
-Wdeprecated-anon-enum-enum-conversion 100 Same as above, for anonymous enums
-Wdeprecated-volatile 6 Increment/decrement of volatile-qualified types (C++20 deprecation)

@matejk matejk added this to the Release 1.15.0 milestone Dec 16, 2025
@matejk matejk merged commit b79b07c into main Dec 17, 2025
123 of 124 checks passed
@matejk matejk deleted the fix-compiler-warnings branch December 17, 2025 06:53
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.

1 participant