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

build: enable strict standards conformance with cl (msvc) #1317

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

invertego
Copy link
Contributor

From the MSVC docs: "You can use the /permissive- compiler option to specify standards-conforming compiler behavior. This option disables permissive behaviors, and sets the /Zc compiler options for strict conformance."

While generally a positive thing, this does make MSVC stricter than GCC/Clang in some cases. A couple of things popped out:

  • nall::multiFactorImage had a busted constructor. I fixed this and did some other cleanup while I was at it.
  • nall::string has an implicit conversion operator to const char*. This is honestly really ugly and creates ambiguity and allows for all kinds of surprising silent conversions. Unfortunately, fixing that (by making it explicit) will require touching hundreds of lines of code so I opted not to deal with it now. Instead I fixed the much smaller number of ambigous cases relating to string literals.

From the MSVC docs: "You can use the /permissive- compiler option to
specify standards-conforming compiler behavior. This option disables
permissive behaviors, and sets the /Zc compiler options for strict
conformance."

While generally a positive thing, this does make MSVC stricter than
GCC/Clang in some cases. A couple of things popped out:

- nall::multiFactorImage had a busted constructor. I fixed this and did
  some other cleanup while I was at it.
- nall::string has an implicit conversion operator to const char*. This
  is honestly really ugly and creates ambiguity and allows for all kinds
  of surprising silent conversions. Unfortunately, fixing that (by
  making it explicit) will require touching hundreds of lines of code so
  I opted not to deal with it now. Instead I fixed the much smaller
  number of ambigous cases relating to string literals.
@LukeUsher LukeUsher merged commit c00e402 into ares-emulator:master Dec 4, 2023
9 checks passed
@invertego invertego deleted the conformance branch December 4, 2023 13:16
invertego added a commit to invertego/ares that referenced this pull request Dec 13, 2023
…tor#1317)

From the MSVC docs: "You can use the /permissive- compiler option to
specify standards-conforming compiler behavior. This option disables
permissive behaviors, and sets the /Zc compiler options for strict
conformance."

While generally a positive thing, this does make MSVC stricter than
GCC/Clang in some cases. A couple of things popped out:

- nall::multiFactorImage had a busted constructor. I fixed this and did
some other cleanup while I was at it.
- nall::string has an implicit conversion operator to const char*. This
is honestly really ugly and creates ambiguity and allows for all kinds
of surprising silent conversions. Unfortunately, fixing that (by making
it explicit) will require touching hundreds of lines of code so I opted
not to deal with it now. Instead I fixed the much smaller number of
ambigous cases relating to string literals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants