* Fix Tru64 UNIX Ada bootstrap
@ 2011-08-03 13:05 Rainer Orth
2011-08-03 13:12 ` Arnaud Charlet
0 siblings, 1 reply; 5+ messages in thread
From: Rainer Orth @ 2011-08-03 13:05 UTC (permalink / raw)
To: gcc-patches; +Cc: Arnaud Charlet
Tru64 UNIX Ada bootstrap was broken, too:
/vol/gcc/src/hg/trunk/solaris/gcc/ada/init.c: In function 'void __gnat_error_handler(int, siginfo_t*, void*)':
/vol/gcc/src/hg/trunk/solaris/gcc/ada/init.c:382:50: error: cast from type 'const char*' to type 'char*' casts away qualifiers [-Werror=cast-qual]
cc1plus: all warnings being treated as errors
Fixed as follows, bootstrap is well beyond the failure now.
Ok for mainline?
Rainer
2011-08-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* init.c [__alpha__ && __osf__] (__gnat_error_handler): Use
CONST_CAST2.
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -379,7 +379,8 @@ __gnat_error_handler (int sig, siginfo_t
}
recurse = 0;
- Raise_From_Signal_Handler (exception, (char *) msg);
+ Raise_From_Signal_Handler (exception,
+ CONST_CAST2 (char *, const char *, msg));
}
void
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fix Tru64 UNIX Ada bootstrap
2011-08-03 13:05 Fix Tru64 UNIX Ada bootstrap Rainer Orth
@ 2011-08-03 13:12 ` Arnaud Charlet
2011-08-04 17:45 ` Rainer Orth
0 siblings, 1 reply; 5+ messages in thread
From: Arnaud Charlet @ 2011-08-03 13:12 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches
> Fixed as follows, bootstrap is well beyond the failure now.
>
> Ok for mainline?
OK, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fix Tru64 UNIX Ada bootstrap
2011-08-03 13:12 ` Arnaud Charlet
@ 2011-08-04 17:45 ` Rainer Orth
2011-08-05 9:43 ` Arnaud Charlet
0 siblings, 1 reply; 5+ messages in thread
From: Rainer Orth @ 2011-08-04 17:45 UTC (permalink / raw)
To: Arnaud Charlet; +Cc: gcc-patches, Joseph S. Myers
Arnaud,
>> Fixed as follows, bootstrap is well beyond the failure now.
>>
>> Ok for mainline?
>
> OK, thanks.
unfortunately, it turned out that this fix only works when compiling
ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
I need the following patch instead, which is also simpler for using
CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
tsystem.h, where it doesn't have to care about non-gcc compilers and
older versions of gcc.
alpha-dec-osf5.1b bootstrap has completed, make check currently
running. Of for mainline if that passes?
Thanks.
Rainer
2011-08-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc:
* tsystem.h (CONST_CAST2, CONST_CAST): Define.
gcc/ada:
* init.c [__alpha__ && __osf__] (__gnat_error_handler): Use
CONST_CAST.
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -379,7 +379,7 @@ __gnat_error_handler (int sig, siginfo_t
}
recurse = 0;
- Raise_From_Signal_Handler (exception, (char *) msg);
+ Raise_From_Signal_Handler (exception, CONST_CAST (char *, msg));
}
void
diff --git a/gcc/tsystem.h b/gcc/tsystem.h
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -1,6 +1,7 @@
/* Get common system includes and various definitions and declarations
based on target macros.
- Copyright (C) 2000, 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2005, 2009, 2011
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -128,6 +129,9 @@ extern int errno;
unreachable default case of a switch. Do not use gcc_assert(0). */
#define gcc_unreachable() (abort ())
+#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
+#define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X))
+
/* Filename handling macros. */
#include "filenames.h"
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fix Tru64 UNIX Ada bootstrap
2011-08-04 17:45 ` Rainer Orth
@ 2011-08-05 9:43 ` Arnaud Charlet
2011-08-05 12:31 ` Rainer Orth
0 siblings, 1 reply; 5+ messages in thread
From: Arnaud Charlet @ 2011-08-05 9:43 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, Joseph S. Myers
> unfortunately, it turned out that this fix only works when compiling
> ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
> I need the following patch instead, which is also simpler for using
> CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
> tsystem.h, where it doesn't have to care about non-gcc compilers and
> older versions of gcc.
>
> alpha-dec-osf5.1b bootstrap has completed, make check currently
> running. Of for mainline if that passes?
The Ada part is OK. I can't formally approve the tsystem.h bit though.
Arno
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fix Tru64 UNIX Ada bootstrap
2011-08-05 9:43 ` Arnaud Charlet
@ 2011-08-05 12:31 ` Rainer Orth
0 siblings, 0 replies; 5+ messages in thread
From: Rainer Orth @ 2011-08-05 12:31 UTC (permalink / raw)
To: Arnaud Charlet; +Cc: gcc-patches, Joseph S. Myers
Arnaud Charlet <charlet@adacore.com> writes:
>> unfortunately, it turned out that this fix only works when compiling
>> ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
>> I need the following patch instead, which is also simpler for using
>> CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
>> tsystem.h, where it doesn't have to care about non-gcc compilers and
>> older versions of gcc.
>>
>> alpha-dec-osf5.1b bootstrap has completed, make check currently
>> running. Of for mainline if that passes?
>
> The Ada part is OK. I can't formally approve the tsystem.h bit though.
Since this fixes a bootstrap failure, I've installed the patch,
considering the tsystem.h part obvious.
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-05 12:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 13:05 Fix Tru64 UNIX Ada bootstrap Rainer Orth
2011-08-03 13:12 ` Arnaud Charlet
2011-08-04 17:45 ` Rainer Orth
2011-08-05 9:43 ` Arnaud Charlet
2011-08-05 12:31 ` Rainer Orth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).