This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RISC-V: Fix elfutils testsuite unwind failures.

On Mon, Feb 4, 2019 at 2:36 PM DJ Delorie <> 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 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
explicit return.

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]