Skip to content

Fixes and constrained suppression of compiler warnings#110

Open
jbcoe wants to merge 1 commit intoNetHack-LE:mainfrom
jbcoe:jbcoe/compile-warning-suppression
Open

Fixes and constrained suppression of compiler warnings#110
jbcoe wants to merge 1 commit intoNetHack-LE:mainfrom
jbcoe:jbcoe/compile-warning-suppression

Conversation

@jbcoe
Copy link
Collaborator

@jbcoe jbcoe commented Mar 23, 2026

  • Suppress target-specific compiler warnings for non-MSVC builds

  • Fix format specifier in error message

@jbcoe jbcoe marked this pull request as draft March 23, 2026 16:34
@jbcoe jbcoe marked this pull request as ready for review March 24, 2026 08:53
@jbcoe jbcoe requested a review from StephenOman March 24, 2026 08:53
@StephenOman
Copy link
Collaborator

What is the purpose of limiting the noisy warning suppression to non-MVSC?

@jbcoe
Copy link
Collaborator Author

jbcoe commented Mar 24, 2026

I don't think that the suppressions I have specified will work on MSVC.

We could consider

target_compile_options(makedefs PRIVATE 
    $<$<CXX_COMPILER_ID:MSVC>:/wd4996>
    $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated-non-prototype>
)

(or equivalent) as I think that MSVC will likely treat -Wno-deprecated-non-prototype as an unknown command-line option and trigger an error (or a warning about an invalid argument).

I don't have access to MSVC to be able to check.

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