Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex doesn't compile under clang-cl with warnings-as-errors=on #219

Closed
pdimov opened this issue Sep 2, 2024 · 3 comments
Closed

Regex doesn't compile under clang-cl with warnings-as-errors=on #219

pdimov opened this issue Sep 2, 2024 · 3 comments

Comments

@pdimov
Copy link
Member

pdimov commented Sep 2, 2024

E.g. https://github.com/boostorg/unordered/actions/runs/10655219740/job/29532497175?pr=277#step:6:489

compile-c-c++ bin.v2\libs\regex\build\clng-win-16.0.\dbg\x86_3\cxstd-14-iso\inln-on\optmz-spc\thrd-mlt\wide_posix_api.obj
C:\actions-runner\_work\unordered\boost-root\libs\regex\build\..\src\wide_posix_api.cpp(199,21): error: 'wcscpy' is deprecated: This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Werror,-Wdeprecated-declarations]
               std::wcscpy(buf, localbuf);
                    ^

This wasn't a problem before the modular changes because Serialization is referenced with <warnings>off here

https://github.com/boostorg/unordered/blob/21937249c47da1fbdb445dc40775a88832fd772d/test/Jamfile.v2#L156

However, post the modular changes Serialization depends on Regex, and <warnings>off doesn't get propagated to the Regex build for some reason, resulting in the error above.

I see that a PR addressing this (#218) has already been merged, but it doesn't seem to help for some reason.

The preprocessor condition should probably check for the MS STL, rather than specific compilers.

@pdimov
Copy link
Member Author

pdimov commented Sep 2, 2024

Or maybe the file should just define _CRT_SECURE_NO_WARNINGS at the top and dispense with the #ifs.

@pdimov
Copy link
Member Author

pdimov commented Sep 2, 2024

#220 implements the first suggested fix. I'll make a second PR for the second.

@pdimov
Copy link
Member Author

pdimov commented Sep 2, 2024

#221 implements the second suggested fix.

I've verified locally that both work.

jzmaddock added a commit that referenced this issue Sep 3, 2024
Define _CRT_SECURE_NO_WARNINGS instead of using wcscpy_s. Fixes #219.
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 a pull request may close this issue.

1 participant