This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: error message egcs


On Mar  2, 1999, Hermann Rochholz <Hermann.Rochholz@faidor.de> wrote:

> In file included from
> /opt_prog/local/lib/gcc-lib/alphaev56-dec-osf4.0d/egcs-2.91.60/include/pthread.h:333,
>                  from gthread-posix.c:34,
>                  from gthread.c:42:
> /usr/include/c_asm.h:193: parse error before `asm'

>         float  fasm( const char *,... );
>         long   asm( const char *,...);
>         double dasm( const char *,... );

> #pragma intrinsic( fasm )
> #pragma intrinsic( asm )
> #pragma intrinsic( dasm )

This problem is fixed in the current development snapshots, but not in 
upcoming egcs 1.1.2 :-(

Thu Dec 17 18:21:49 1998  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
[snip]
	* fixincludes (c_asm.h): Wrap Digital UNIX V4.0B DEC C specific
	asm() etc. function declarations in __DECC.

Maybe we should consider including this in egcs 1.1.2.  This is the
second report about this problem I reply to this week, and the patch
(attached) seems safe enough for 1.1.2.  Jeff, what do you think?

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil
Index: fixincludes
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixincludes,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- fixincludes	1998/12/16 20:55:38	1.16
+++ fixincludes	1998/12/17 18:22:30	1.17
@@ -2537,6 +2537,36 @@
   fi
 fi
 
+# Fix <c_asm.h> on Digital UNIX V4.0:
+# It contains a prototype for a DEC C internal asm() function, clashing with
+# gcc's asm keyword.  So protect this with __DECC.
+file=c_asm.h
+if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+  cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+  chmod +w ${LIB}/$file 2>/dev/null
+  chmod a+r ${LIB}/$file 2>/dev/null
+fi
+
+if [ -r ${LIB}/$file ]; then
+  echo Fixing $file
+  sed -e '/^[ 	]*float[ 	]*fasm/i\
+#ifdef __DECC
+' \
+      -e '/^[ 	]*#[ 	]*pragma[ 	]*intrinsic([ 	]*dasm/a\
+#endif
+' ${LIB}/$file > ${LIB}/${file}.sed
+  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+  if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+    rm ${LIB}/$file
+  else
+    # Find any include directives that use "file".
+    for include in `egrep '^[       ]*#[    ]*include[      ]*"[^/]' ${LIB}/$file | sed -e 's/^[    ]*#[    ]*include[      ]*"\([^"]*\)".*$/\1/'`; do
+      dir=`echo $file | sed -e s'|/[^/]*$||'`
+      required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
+    done
+  fi
+fi
+
 # This file on SunOS 4 has a very large macro.  When the sed loop
 # tries pull it in, it overflows the pattern space size of the SunOS
 # sed (GNU sed does not have this problem).  Since the file does not

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