Skip to content

abseil-cpp: define _CRT_SECURE_NO_WARNINGS like abseil's own build - #2973

Open
ContradNamiseb wants to merge 3 commits into
mesonbuild:masterfrom
ContradNamiseb:abseil-cpp-crt-secure-no-warnings
Open

ContradNamiseb wants to merge 3 commits into
mesonbuild:masterfrom
ContradNamiseb:abseil-cpp-crt-secure-no-warnings

Conversation

@ContradNamiseb

@ContradNamiseb ContradNamiseb commented Oct 20, 2026 •

Copy link
Copy Markdown

Building abseil-cpp on Windows warns that strcpy, strncpy and getenv are unsafe, in absl/strings/numbers.cc, absl/synchronization/mutex.cc, absl/debugging/symbolize_win32.inc and absl/log/flags.cc. For example, from an icx build of 20240722.0 (the same calls are still in 20250814.1):

absl/strings/numbers.cc(556,5): warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

abseil's own build passes /D_CRT_SECURE_NO_WARNINGS together with /DNOMINMAX (absl/copts/copts.py), but the meson port only has /DNOMINMAX. This adds the define and bumps the revision to 20250814.1-3. It builds on #2974, so until that is merged this diff includes its commits.

AI disclosure

This PR was made with the help of AI and was verified by me.

The port predates three sanity checks: the wrap used the name = dep
provide form, meson_version was >=0.49.0 and the port was not formatted
with meson format. List dependency_names in the wrap and override each
name in the port, as ftxui did in dc9d1b5, require meson >=0.56.0, and
format the port.
@ContradNamiseb

Copy link
Copy Markdown
Author

The failing checks come from rules the abseil-cpp port predates (meson format, the [provide] syntax and meson_version), not from this change. #2974 updates the port; once it is merged I'll rebase this on top.

sanity_checks.py requires a new release whenever the port's files change.
abseil's CMake and Bazel builds pass /D_CRT_SECURE_NO_WARNINGS with
/DNOMINMAX on Windows (absl/copts/copts.py), but the meson port only
passes /DNOMINMAX, so building on Windows warns about strcpy, strncpy and
getenv.
@ContradNamiseb
ContradNamiseb force-pushed the abseil-cpp-crt-secure-no-warnings branch from fa61ca9 to 1967e69 Compare October 20, 2026 07:45

This branch has not been deployed

No deployments
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