Skip to content

fix: Resolve compiler warnings and fix potential bugs#5130

Merged
matejk merged 8 commits intomainfrom
fix-various-compiler-warnings
Dec 22, 2025
Merged

fix: Resolve compiler warnings and fix potential bugs#5130
matejk merged 8 commits intomainfrom
fix-various-compiler-warnings

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Dec 20, 2025

Summary

Comprehensive compiler warning fixes across GCC, Clang (macOS), and MSVC builds.

Metric Count
Files Modified 80
Lines Changed +3622 / -2730
Bug Fixes 5 critical + 2 high + 8 potential
Warnings Resolved ~100+

Critical Bug Fixes

1. RegularExpression.cpp - PCRE2 Unset Match Detection

Check for unset capture groups was ALWAYS FALSE (ovec[0] < 0 on unsigned type).

2. ProcessRunner.h - Windows Invalid PID Value

INVALID_PID = -1 is wrong on Windows where PIDs are unsigned and 0 indicates invalid.

3. ProcessRunner.cpp - PID Type Mismatch

PID file parsing used int instead of platform-specific PID type.

4. IPAddressImpl.cpp - Missing Base Class Initialization

Copy constructors didn't explicitly initialize RefCountedObject base class.

5. X509Certificate.cpp - Variable Shadowing

Inner loop iterator shadowed outer loop iterator.

6. NumericString.h safeMultiply - Overflow Detection

Overflow detection comparisons could give wrong results with mixed signed/unsigned types.

7. CppUnit TestCase.h - Test Assertions

assertEquals could give incorrect results comparing signed vs unsigned values.

Other Changes

  • Third-party update: Tessil/ordered-map v1.2.0 (fixes -Wdeprecated-copy)
  • ODBC null constants: Added constexpr null handle constants to avoid -Wzero-as-null-pointer-constant
  • Var.h: Use demangled type names in exception messages
  • API docs: Added POCO_DEPRECATED and migration docs for Observer class
  • Zip module: Fixed enum arithmetic for MSVC C++20 compatibility

Compiler Coverage

Compiler Platform Warnings Addressed
GCC Linux Type-limits, zero-as-null, fallthrough, base-init, sign-compare
Clang macOS Sign-compare, deprecated-copy
MSVC Windows C4244, C4245, C4456, C5054, C4702, C4018

Test plan

  • CI passes on all platforms (Linux, macOS, Windows)
  • No regressions in existing tests

@matejk matejk added this to the Release 1.15.0 milestone Dec 20, 2025
Update third-party Tessil/ordered-map library from outdated version
to v1.2.0 (November 2018).

Changes from upstream:
- Fix -Wdeprecated-copy warning by adding explicit default copy/move
  assignment operators
- Bug fixes for insert_at_position and erase methods
- Added erase_if function and contains() methods
- Better GCC 9+ compatibility
- Serialization support

Source: https://github.com/Tessil/ordered-map/releases/tag/v1.2.0
@matejk matejk force-pushed the fix-various-compiler-warnings branch from 67c7a6c to af894ec Compare December 22, 2025 08:56
@matejk matejk force-pushed the fix-various-compiler-warnings branch from ecabb2c to 15ba8ee Compare December 22, 2025 11:59
@matejk matejk merged commit 1461ec6 into main Dec 22, 2025
123 of 124 checks passed
@matejk matejk deleted the fix-various-compiler-warnings branch December 22, 2025 14:27
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.

2 participants