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

Option to build d3dx12_property_format_table.cpp with exceptions disabled #117

Closed
apache-hb opened this issue Jan 22, 2024 · 1 comment · Fixed by #144
Closed

Option to build d3dx12_property_format_table.cpp with exceptions disabled #117

apache-hb opened this issue Jan 22, 2024 · 1 comment · Fixed by #144
Labels
conformance Related to supporting non-MSVC compilers

Comments

@apache-hb
Copy link

Currently GetComponentName, GetBitsPerComponent, and GetDetailTableIndexThrow unconditionally use throw statements. Would it be possible to make this optional in a future release? Perhaps by compiling throws into ASSUME() or providing a TryXXX api.

@walbourn walbourn added the enhancement New feature or request label Nov 7, 2024
@walbourn
Copy link
Member

walbourn commented Nov 7, 2024

Generally speaking, C Exception Handling is part of the standard and is implemented efficiently with little to no runtime cost when exceptions are NOT thrown for x64, ARM, and ARM64. It's only the x86 implementation of C Exception handling that has code-gen impacts. As such, with x64 native code there's really no point in building without /EHsc.

``/EHa` as required by Managed C does have impacts on optimization choices, so this advice doesn't apply to this particular scenario.

That said, the current implementation of throw E_FAIL; seems problematic in general. It would make more sense to make use of stdexcept which is at least C Standard Comformant.

@walbourn walbourn added conformance Related to supporting non-MSVC compilers and removed enhancement New feature or request labels Nov 7, 2024
@walbourn walbourn linked a pull request Nov 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conformance Related to supporting non-MSVC compilers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants