History

configure: allow mixed declarations and code for Objective-C

Mixing declarations and code is quite common in Objective-C (as can be seen by the number of warnings we have for this in Objective-C files) and forcing to not do it usually results in worse code, with unnecessary widely scoped variables, which in turn makes variable shadowing and accidentally using the wrong variable more common and harder to notice.

Marvin Scholz committed 2 years ago

Commit 81ca85a1 parent 163e5fd1 file · +4 −0Browse files

Unified · Split

configure+4−0
@@ -7500,6 +7500,10 @@ check_disable_warning -Wno-bool-operation · 7499 unmodified lines
7500check_disable_warning -Wno-char-subscripts7500check_disable_warning -Wno-char-subscripts
7501check_disable_warning -Wno-implicit-const-int-float-conversion7501check_disable_warning -Wno-implicit-const-int-float-conversion
7502 7502
7503# Disable mixed decl and code warning for Objective-C
7504test_objcflags $unknown_warning_flags '-Wdeclaration-after-statement' &&
7505 add_objcflags '-Wno-declaration-after-statement'
7506
7503check_disable_warning_headers(){7507check_disable_warning_headers(){
7504 warning_flag=-W${1#-Wno-}7508 warning_flag=-W${1#-Wno-}
7505 test_cflags $warning_flag && add_cflags_headers $17509 test_cflags $warning_flag && add_cflags_headers $1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t