I built gcc-2.95 over the weekend and then tried building the
development strand with it. I've attached two patches that are
necessary to make it build. One is a patch to the LyX sources and the
other is a patch against the autoconf files in /usr/share/autoconf.
In addition to the autoconf patch its necessary to regenerate two of
autoconf's files (they're also in /usr/share/autoconf) :
m4 -F autoconf.m4f autoconf.m4
m4 -F autoheader.m4f autoheader.m4
Anyway, the reason I'm sending these to the list rather than just
committing the changes is because I'm unsure of one of the changes.
Asger, this is mainly up to you but I had to make a change to
StableIterator.h in order to get things compiling. GCC complains about
your use of "value_type" and I found it necessary to use "typename
T::value_type" Is this right? I've never seen typename before and as I
understand the code this should be the right answer here.
Another question: Shouldn't we be using the newer (now standard)
iterator_traits<> scheme rather than the now deprecated HP scheme?
Most of the changes are adding const_cast's where we are changing the
contents of an inset after fetching it using
Paragraph::GetInset()const. Perhaps we should have a non-const version
of this method instead?
I've now got gcc-2.95 and egcs-1.1.2 co-existing and these fixes work
with both. Sadly, lyx crashes on startup irrespective of what compiler
I use. So that's the next challenge. Lars, I know you've been doing a
lot here and I don't have heaps of time so I thought I might tackle
getting the -nw option working a bit better (it crashes) so we can debug
the startup without having a splashscreen causing problems.
--
Allan. (ARRae)
P.S. I'll send the autoconf patch off to the maintainers tomorrow after
I've checked whether there's an update available yet.
P.P.S Does anyone have a definitive answer on whether its an error to
not define a const when its declared? That is:
int const x;
is an error according to gcc-2.95 and a recent sgi compiler. Autoconf's
tests for broken const detect this and then when you try to compile
"const" has been undef'd and all sorts of errors result.
arrae-990810.patch.gz
--- acgeneral.m4.orig Sun Aug 8 00:02:39 1999
+++ acgeneral.m4 Sun Aug 8 00:03:21 1999
@@ -1988,7 +1988,7 @@
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[AC_TRY_RUN([#include <stdio.h>
-main()
+int main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
--- acspecific.m4.orig Sat Aug 7 23:58:20 1999
+++ acspecific.m4 Sun Aug 8 14:45:13 1999
@@ -1679,7 +1679,7 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-extern select
($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl
+extern int select
+($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl
[ac_not_found=no ; break 3],ac_not_found=yes)
done
done
@@ -1885,7 +1885,7 @@
[AC_CACHE_CHECK([for inline], ac_cv_c_inline,
[ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
+ AC_TRY_COMPILE(, [} $ac_kw int foo() {], [ac_cv_c_inline=$ac_kw; break])
done
])
case "$ac_cv_c_inline" in
@@ -1903,7 +1903,7 @@
changequote(<<, >>)dnl
<<
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
+/*typedef int charset[2]; const charset x;*/
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;