This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] RISC-V: Fix elfutils testsuite unwind failures.
- From: Jim Wilson <jimw at sifive dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 4 Feb 2019 15:01:14 -0800
- Subject: Re: [PATCH] RISC-V: Fix elfutils testsuite unwind failures.
- References: <firstname.lastname@example.org> <email@example.com>
On Mon, Feb 4, 2019 at 2:36 PM DJ Delorie <firstname.lastname@example.org> wrote:
> main() should return something in the fall-through case, be it zero
> (main should exit) or 1 (code shouldn't be reached), now that main()
> doesn't end with _Unwind_Backtrace() itself, if for no reason than to
> avoid future warnings.
The original testcase doesn't end with _Unwind_Backtrace().
_Unwind_Backtrace returns, and then it falls through the bottom of
main. Just like my testcase. I was just following the same style. I
don't know if that was intentional or not. By the way, the ISO C
standard allows programs to fall through the bottom of main. This is
defined as exactly equivalent to returning 0. Looking at the ISO C
2011 standard, section 22.214.171.124.3 Program termination, "reaching the }
that terminates the main function returns a value of 0". The testcase
fails if _Unwind_Backtrace() does not return, in which case the alarm
triggers, and the alarm signal handler exits with an error. If
_Unwind_Backtrace() returns then the testcase passed. FYI
elf/tst-initorder.c has the same style, a main function without an
Anyways, adding a return 0 at the bottom of main is fine with me, I
write my own code that way, and it doesn't change the effect of the
I don't have write access to glibc. Do you want me to send an updated
patch? Or just fix it yourself and commit it?