Skip to content

Windows build without warnings (4.0.2) - #186

Merged
compot-dev merged 1 commit into
masterfrom
mingw-warnings
Nov 18, 2026
Merged

compot-dev merged 1 commit into
masterfrom
mingw-warnings

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

The Windows build of 4.0.1 warned in two places; docker/test-windows.sh (#184) showed them.

  • src/net.c: the log line of a bad TCP frame length printed size_t values with %zu. The Windows build's printf format check rejects it ("unknown conversion type character 'z'") and the arguments after it could be logged wrong. They are now printed as unsigned long, as elsewhere in the code.
  • src/tun.c: tun_persistent is used only outside Windows; it is no longer defined in the Windows build ("defined but not used").

Version 4.0.2, CHANGELOG entry added.

Checked locally: docker/test-windows.sh (x86_64 and i686, no warnings, --version/--help under Wine), the native build with make test, and the static musl builds for x86_64, aarch64, arm and mipsel — no warnings.

…ent off Windows

The log line of a bad TCP frame length printed size_t values with %zu,
which the Windows build's printf format check rejects (and could log wrong
numbers there): printed as unsigned long now. tun_persistent is used only
outside Windows and is no longer defined in the Windows build. Found by
docker/test-windows.sh (#184). Version 4.0.2.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Eliminate Windows build warnings and release version 4.0.2

🐞 Bug fix 📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Fix TCP frame-error logging so Windows accepts its size format specifiers.
• Exclude unused TUN persistence state from Windows builds.
• Bump the version to 4.0.2 and document the fixes.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The version header is explicitly the shared source used by userspace, kernel-module, Android, and package metadata.
  • These are propagation hops for one bounded release-identity behavior, not independent user capabilities.
Sources

src/version.h[15-17]

#ifndef CAMEX_VERSION
#define CAMEX_VERSION "4.0.2"
#endif
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before: consumers read the single CAMEX_VERSION literal.
  • After: the literal is updated to the new release value.
  • New correctness condition: all generated and displayed release metadata must consistently reflect the intended version.
  • This is a direct constant update using unchanged consumers, with no new compatibility cases, branches, state transitions, or coordination protocol.
Sources

src/version.h[15-17]

#ifndef CAMEX_VERSION
#define CAMEX_VERSION "4.0.2"
#endif
Potential damage 🟢 Low 🩹 Cosmetic

  • An incorrect release string would be visible in version output, package naming, or module metadata, but does not corrupt persistent state, alter network compatibility, or cause an external side effect.
  • Correcting the source and rebuilding repairs newly produced artifacts; already distributed artifacts retain their existing embedded metadata until replaced.
  • Reversible through a corrected rebuild and redeployment.
  • No persistent-state repair or external compensation is required.
Sources

src/version.h[15-17]

#ifndef CAMEX_VERSION
#define CAMEX_VERSION "4.0.2"
#endif
Assessed commit ade847f > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  A["TCP frame check"] --> B["Error log formatting"] --> E["Windows build"]
  C["TUN persistence"] --> D["Platform guard"] --> E
Loading
High-Level Assessment

The localized fixes fit two independent compiler warnings without changing TCP framing or TUN behavior. A broader logging abstraction is unnecessary for this single format string; the logged buffer sizes in current callers are bounded.

Files changed (4) +12 / -3

Bug fix (2) +4 / -2
net.cUse Windows-compatible formats for invalid TCP frame lengths +2/-2

Use Windows-compatible formats for invalid TCP frame lengths

• Changes the invalid-body-length log from '%zu' to '%lu' and casts both size arguments to unsigned long, avoiding the Windows format warning and argument mismatch.

src/net.c

tun.cExclude unused TUN persistence state on Windows +2/-0

Exclude unused TUN persistence state on Windows

• Wraps the 'tun_persistent' declaration in a non-Windows conditional, matching the platforms where it is used.

src/tun.c

Documentation (1) +7 / -0
CHANGELOG.mdDocument the 4.0.2 Windows warning fixes +7/-0

Document the 4.0.2 Windows warning fixes

• Adds a 4.0.2 entry describing the TCP logging and TUN declaration fixes and their discovery through the Windows test script.

CHANGELOG.md

Other (1) +1 / -1
version.hSet the release version to 4.0.2 +1/-1

Set the release version to 4.0.2

• Bumps the shared 'CAMEX_VERSION' string from 4.0.1 to 4.0.2.

src/version.h

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 90ad5f4 into master Nov 18, 2026
18 checks passed
@compot-dev
compot-dev deleted the mingw-warnings branch November 18, 2026 08:48
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.

1 participant