Skip to content

Commit dd4be07

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix -Wbitwise-instead-of-logical in 5 files starting w/ fbpcs/emp_games/pcf2_attribution/AttributionRule_impl.h (#9310)
Summary: Pull Request resolved: #9310 X-link: facebookincubator/dynolog#89 X-link: facebookresearch/fbpcf#462 X-link: facebookresearch/fbpcs#2016 With LLVM-15, `&&` and `||` are required for boolean operands, rather than `&` and `|` which can be confused for bitwise operations. Fixing such ambiguity helps makes our code more readable. - If you approve of this diff, please use the "Accept & Ship" button :-) Differential Revision: D42347735 fbshipit-source-id: 3ec9c8af880cfce6490787662a4c3bc28f990bc7
1 parent f1e8bcb commit dd4be07

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

hphp/runtime/base/runtime-option.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,13 +1416,17 @@ static std::vector<std::string> getTierOverwrites(IniSetting::Map& ini,
14161416
// Check the patterns one by one so they all get evaluated; otherwise, when
14171417
// using "&&" in a single expression with multiple patterns, if an earlier
14181418
// one fails to match, the later one would be reported as unused.
1419+
#pragma clang diagnostic push
1420+
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
14191421
auto matched = true;
14201422
matched &= Config::matchHdfPattern(hostname, ini, hdf, "machine");
14211423
matched &= Config::matchHdfPattern(tier, ini, hdf, "tier");
14221424
matched &= Config::matchHdfPattern(task, ini, hdf, "task");
14231425
matched &= Config::matchHdfPattern(tiers, ini, hdf, "tiers", "m");
14241426
matched &= Config::matchHdfPattern(tags, ini, hdf, "tags", "m");
14251427
matched &= Config::matchHdfPattern(cpu, ini, hdf, "cpu");
1428+
#pragma clang diagnostic pop
1429+
14261430
return matched;
14271431
};
14281432

@@ -1433,10 +1437,14 @@ static std::vector<std::string> getTierOverwrites(IniSetting::Map& ini,
14331437
// Check the patterns one by one so they all get evaluated; otherwise, when
14341438
// using "&&" in a single expression with multiple patterns, if an earlier
14351439
// one fails to match, the later one would be reported as unused.
1440+
#pragma clang diagnostic push
1441+
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
14361442
auto matched = true;
14371443
matched &= checkPatterns(hdf);
14381444
matched &= !hdf.exists("exclude") || !checkPatterns(hdf["exclude"]);
14391445
matched &= matchShard(enableShards, hostname, ini, hdf, messages);
1446+
#pragma clang diagnostic pop
1447+
14401448
return matched;
14411449
};
14421450

hphp/runtime/ext/hsl/hsl_locale_libc_ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ String HSLLocaleLibcOps::replace_every_nonrecursive_ci(const String& haystack,
331331
haystack,
332332
replacements,
333333
/* to_t = */ id,
334-
/* from_t = */ id,
334+
/* from_t = */ id,
335335
/* normalize = */ [](String* s) {},
336336
[](String* s) {
337337
*s = HHVM_FN(strtolower)(*s);

0 commit comments

Comments
 (0)