Skip to content

Commit

Permalink
Bug 1879225: Disable narrowing warning for irregexp r=dminor
Browse files Browse the repository at this point in the history
This is necessary because of an awkward bit of code [here in regexp-nodes.h](https://github.com/v8/v8/blob/ed3c1170334fc215917de4409750d22f484475f1/src/regexp/regexp-nodes.h#L360-L363) that uses a struct initializer to create a RegExpFlags. C++ initializers do not do type conversions, so if we initialize RegExpFlags with an int, then the member field of RegExpFlags must also be an int. V8's RegExpFlags is backed by an int, but we use a uint8_t.

I based the clang/gcc flags on the #pragmas [here](https://searchfox.org/mozilla-central/source/mozglue/tests/TestPrintf.cpp#14-20).

Differential Revision: https://phabricator.services.mozilla.com/D201920
  • Loading branch information
iainireland committed Feb 28, 2024
1 parent e85596f commit eace9d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/src/irregexp/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ include("../js-cxxflags.mozbuild")

CXXFLAGS += ["-Wno-error=type-limits", "-Wno-error=return-type"]

# Suppress spurious warnings in third-party code. See bug 1810584.
# Suppress spurious warnings in third-party code.
# See bug 1810584 and bug 1879225.
if CONFIG["CC_TYPE"] == "gcc":
CXXFLAGS += ["-Wno-error=nonnull"]
CXXFLAGS += ["-Wno-error=nonnull", "-Wno-narrowing"]
if CONFIG["CC_TYPE"] == "clang":
CXXFLAGS += ["-Wno-c++11-narrowing"]


UNIFIED_SOURCES += [
"imported/regexp-bytecode-generator.cc",
Expand Down

0 comments on commit eace9d8

Please sign in to comment.