Opened 4 weeks ago

Closed 3 weeks ago

Last modified 13 days ago

#31769 closed defect (worksforme)

-Wextra-semi causes build failure on debian bullseye

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.4.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 042-should?
Cc: Actual Points: .1
Parent ID: Points:
Reviewer: Sponsor:


From jenkins:,SUITE=bullseye/4153/consoleFull

09:00:39 cc1: warning: command line option '-Wextra-semi' is valid for C++/ObjC++ but not for C

The logical solution here is to remove the flag.

Child Tickets

Change History (11)

comment:1 Changed 4 weeks ago by nickm

Except that the flag apparently does something different on clang: 80f1a2cbbdd0abd509711a5069f31855df5bcd79 .

comment:2 Changed 4 weeks ago by nickm

Debian bullseye apparently has GCC 9.2.1:

But 9.2.1 is not apparently released yet:

I think we should prepare a fix, but I think this is not a release blocker.

comment:3 Changed 4 weeks ago by nickm

Actual Points: .1
Keywords: 042-should? added

comment:4 Changed 4 weeks ago by nickm

Status: assignedneeds_review

See branch bug31769_029; is a PR that merges it to master.

I don't think we should merge this unless it becomes apparent that GCC will not fix their bug.

comment:5 Changed 4 weeks ago by nickm

This may be a debian-only issue: I have just noticed that apparently my fedora desktop also claims to have GCC 9.2.1, but compilation is passing. Apparently this happens because -Wextra-semi is detected as unsupported in the autoconf script:

configure:18768: checking whether the compiler accepts -Wextra-semi
configure:18787: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wdate-time -Wdouble-promotion -Wduplicate-decl-specifier -Wduplicated-cond -Wextra -pedantic -Werror -Wextra-semi  conftest.c >&5
cc1: error: command line option '-Wextra-semi' is valid for C++/ObjC++ but not for C [-Werror]
cc1: all warnings being treated as errors

comment:6 Changed 4 weeks ago by nickm

The plot grows thicker. On both debian and fedora, this command line gives a warning but returns success:

gcc -Wextra-semi -Werror -c example.c && echo ok

but this one fails:

gcc -Werror -Wextra-semi -c example.c && echo ok

Note that the only difference is the ordering of the -Werror and -Wextra-semi options.

Let's look at our config.log file. On debian the command line that passes is:

gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wdate-time -Wdouble-promotion -Wduplicate-decl-specifier -Wduplicated-cond -Wextra -pedantic -Werror -Wextra-semi conftest.c >&5

And on Fedora the one that fails is:

gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wdate-time -Wdouble-promotion -Wduplicate-decl-specifier -Wduplicated-cond -Wextra -pedantic -Werror -Wextra-semi conftest.c >&5

Those look identical to me.

Moreover, when I run them on a fedora desktop and on a debian bullseye schroot, I (correctly) get a failing exit code from both.

At this point, I am flummoxed.

comment:7 Changed 4 weeks ago by nickm

Status: needs_reviewneeds_information

What's more, tor-ci-linux-master is passing again. Was this some weird transient issue? Are there squirrels nesting in the server rack?

comment:8 Changed 4 weeks ago by nickm

Same failure, but this time on "eoan", which is apparently Ubuntu:,SUITE=eoan/40/console

comment:9 Changed 3 weeks ago by nickm

Resolution: worksforme
Status: needs_informationclosed

Apparently the bug has been fixed in debian and ported to ubuntu.

comment:10 Changed 13 days ago by teor

Keywords: 029-backport 035-backport 040-backport 041-backport 042-should? removed

comment:11 Changed 13 days ago by teor

Keywords: 042-should? added
Note: See TracTickets for help on using tickets.