Skip to content

Commit aa6f1ae

Browse files
authored
Disable -Wrange-loop-analysis for abseil (#807)
absl includes code like this: ``` void fn(std::initializer_list<absl::string_view> pieces) { ... for (const absl::string_view piece : pieces) total_size += piece.size(); ``` clang objects, suggesting that a reference should be used instead, i.e.: ``` for (const absl::string_view& piece : pieces) total_size += piece.size(); ``` But: a) we don't want to touch absl code b) string_views are cheap to copy (and absl recommends copying string_views rather than taking references as it may result in smaller code) c) some brief, naive benchmarking suggests there's no significant different in this case (i.e. (b) is correct.) Note that -Wrange-loop-analysis is already exlicitly enabled in our cmake build.
1 parent ef55eef commit aa6f1ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

FirebaseFirestore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
9090
]
9191

9292
ss.library = 'c++'
93-
ss.compiler_flags = '$(inherited) ' + '-Wno-comma'
93+
ss.compiler_flags = '$(inherited) ' + '-Wno-comma -Wno-range-loop-analysis'
9494
end
9595
end

0 commit comments

Comments
 (0)