Skip to content

Commit 53f7714

Browse files
authored
[runtime] Adopt safer native compiler flags: Wignored-qualifiers (#24068)
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.
1 parent 0db248e commit 53f7714

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

mk/rules.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ CFLAGS=\
3636
-Werror=format-security \
3737
-fdiagnostics-absolute-paths \
3838
-Wno-objc-protocol-property-synthesis \
39+
-Wignored-qualifiers \
3940
-g \
4041
-I.
4142
SWIFTFLAGS=-g -emit-library

runtime/monotouch-main.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
static char original_working_directory_path [MAXPATHLEN];
3131

32-
const char * const
32+
const char *
3333
xamarin_get_original_working_directory_path ()
3434
{
3535
return original_working_directory_path;

runtime/xamarin/runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void xamarin_bridge_raise_unhandled_exception_event (GCHandle exception_gchand
229229
bool xamarin_register_monoassembly (MonoAssembly *assembly, GCHandle *exception_gchandle);
230230
void xamarin_install_nsautoreleasepool_hooks ();
231231
void xamarin_enable_new_refcount ();
232-
const char * const xamarin_get_original_working_directory_path ();
232+
const char * xamarin_get_original_working_directory_path ();
233233
int xamarin_get_runtime_arch ();
234234

235235
MonoObject * xamarin_new_nsobject (id self, MonoClass *klass, GCHandle *exception_gchandle);

0 commit comments

Comments
 (0)