Closed Bug 1933011 Opened 10 days ago Closed 5 days ago

--enable-warnings-as-errors and --disable-unified-build causes -Werror=unreachable-code in modules/libmar/verify/mar_verify.c

Categories

(Toolkit :: Application Update, defect)

defect

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: jgilbert, Assigned: jgilbert, NeedInfo)

Details

Attachments

(2 files)

 4:53.74 /git/gecko1/modules/libmar/verify/mar_verify.c:143:5: error: code will never be executed [-Werror,-Wunreachable-code]
 4:53.74   143 |     fprintf(stderr, "ERROR: Could not init crytpo library.\n");
 4:53.74       |     ^~~~~~~
 4:53.74 1 error generated.

With:
--enable-warnings-as-errors
--disable-unified-build

 4:53.74 /git/gecko1/modules/libmar/verify/mar_verify.c:143:5: error: code will never be executed [-Werror,-Wunreachable-code]
 4:53.74   143 |     fprintf(stderr, "ERROR: Could not init crytpo library.\n");
 4:53.74       |     ^~~~~~~
 4:53.74 1 error generated.

So convert the macro to function, which makes the compiler happy.

Hi Kelsey! For the context: Can you please link the code to the issue causing unreachable lines or has there been a recent CI enforcement of avoiding unreachable code and can we link that bug where it was introduced?

Flags: needinfo?(jgilbert)
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e06aae14caf6 Fix -Werror=unreachable in libmar. r=sylvestre https://hg.mozilla.org/integration/autoland/rev/600681873cdb s/crytpo/crypto/. r=sylvestre,geckoview-reviewers,m_kato

(In reply to Max Christian Pohle [:/dev/max] from comment #3)

Hi Kelsey! For the context: Can you please link the code to the issue causing unreachable lines or has there been a recent CI enforcement of avoiding unreachable code and can we link that bug where it was introduced?

This is not CI, this is on my local linux machine. My best guess is that we only build CI with either --enable-warnings-as-errors xor --disable-unified-build, but never both.

It is kinda suspect that this causes issues with non-unified builds, because that probably means there's a #define or #ifdef interaction that's happening differently in the two builds. However, I need to leave this investigation to a code owner. (FYI @sylvestre)

Flags: needinfo?(jgilbert) → needinfo?(sledru)

Actually wait, you are the triage owner! I'm happy to help you try to replicate it for yourself! But you should merely need to build on Linux with those two options in your .mozconfig.

Here is my complete .mozconfig though:

[gitsh@duat gecko1]$ cat .mozconfig
ac_add_options --disable-debug
ac_add_options --disable-optimize
ac_add_options --enable-warnings-as-errors

ac_add_options --enable-debug
#ac_add_options --enable-optimize
ac_add_options --disable-unified-build

[gitsh@duat gecko1]$
Flags: needinfo?(sledru) → needinfo?(mpohle)
Status: NEW → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: