This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Pedantic error on address-of main breaks libjava bootstrap
- From: Andrew Haley <aph at redhat dot com>
- To: "Aaron W. LaFramboise" <aaronavay62 at aaronwl dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 30 Jul 2008 09:12:07 +0100
- Subject: Re: Pedantic error on address-of main breaks libjava bootstrap
- References: <488F6DD0.8000006@aaronwl.com>
Aaron W. LaFramboise wrote:
> When building libjava stacktrace.o on i386-pc-mingw32, bootstrap fails
> with:
>
>> ./sysdep/backtrace.h: In function '_Unwind_Reason_Code
>> fallback_backtrace(_Unwind_Reason_Code (*)(_Unwind_Context*, void*),
>> _Jv_UnwindState*)':
>> ./sysdep/backtrace.h:107: error: ISO C++ forbids taking address of
>> function '::main'
>
> On mingw32, backtrace.h is a symlink or copy to i386/backtrace.h, which
> is what has this problem:
>
>> if (ctx.meth_addr == (_Jv_uintptr_t)jv_runmain
>> || ctx.meth_addr == (_Jv_uintptr_t)_Jv_ThreadStart
>> || (ctx.meth_addr - (_Jv_uintptr_t)main) < 16)
>> break;
>
> The code needs the address of main to stop the unwind. What is the
> proper way to suppress this warning? __extension__ doesn't seem to help.
>
> (I'm actually not sure what has changed to cause this warning to start
> happening now.)
Please send the command line that led to this.
Thanks,
Andrew.