[runtime] Adopt safer native compiler flags: Wmissing-field-initializers#24071
Conversation
Example warning: ``` macios/runtime/xamarin/runtime.h:232:14: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers] 232 | const char * const xamarin_get_original_working_directory_path (); ``` References: * https://developer.apple.com/documentation/xcode/enabling-enhanced-security-for-your-app * https://releases.llvm.org/8.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features (for -ftrivial-auto-var-init=zero) Contributes towards #23023.
Example warning:
```
In file included from macios/appex-deduplicate-frameworks/macios/runtime/runtime.m:98:
macios/runtime/delegates.inc:189:41: error: missing field 'register_assembly' initializer [-Werror,-Wmissing-field-initializers]
189 | static struct Delegates delegates = { 0 };
| ^
```
References:
* https://developer.apple.com/documentation/xcode/enabling-enhanced-security-for-your-app
* https://releases.llvm.org/8.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features (for -ftrivial-auto-var-init=zero)
Contributes towards #23023.
…atch (#24072) Example warning: ``` macios/runtime/trampolines.m:1784:9: error: cast from 'void *(*)(MonoObject *, void *, GCHandle *)' (aka 'void *(*)(_MonoObject *, void *, void **)') to 'xamarin_managed_to_id_func' (aka 'id (*)(_MonoObject *, void *, void **)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] 1784 | return (xamarin_managed_to_id_func) xamarin_smart_enum_to_nsstring; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` References: * https://developer.apple.com/documentation/xcode/enabling-enhanced-security-for-your-app * https://releases.llvm.org/8.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features (for -ftrivial-auto-var-init=zero) Contributes towards #23023.
✅ [CI Build #294fa88] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #294fa88] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #294fa88] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #294fa88] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #294fa88] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #294fa88] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
💻 [CI Build #294fa88] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #294fa88] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
🚀 [CI Build #294fa88] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 115 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
…Wmissing-field-initializers
Example warning:
References:
Contributes towards #23023.