Subject: misc/8243: Type conflicts in gcc/cplus-dem.c -DMAIN
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ac131313@cygnus.com>
List: netbsd-bugs
Date: 08/19/1999 23:52:18
>Number:         8243
>Category:       misc
>Synopsis:       Type conflicts in gcc/cplus-dem.c -DMAIN
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 19 23:50:10 1999
>Last-Modified:
>Originator:     Andrew Cagney
>Organization:
>Release:        Fri Aug 20 16:26:42 EST 1999
>Environment:
SunOS amy 5.5.1 Generic_105428-01 sun4u sparc SUNW,Ultra-5_10


>Description:
The declaration of xmalloc() in scan.h conflicts with that found in
cplus-dem.c.  This causes a cross compile to fail.

>How-To-Repeat:
$  with_newlib=yes ${srcdir}/gnu/dist/configure \
        --target=${MACHINE_ARCH}-netbsd \
        --prefix=${installdir}
$  gmake M4=gm4 LANGUAGES="c c++" all-gcc all-gas all-ld all-binutils
...
>Fix:
I belive that the later GCC releases address this differently.
You might want to try this with a native build.

Index: gnu/dist/gcc/scan.h
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/gcc/scan.h,v
retrieving revision 1.1.1.2
diff -p -r1.1.1.2 scan.h
*** scan.h      1998/08/16 17:38:21     1.1.1.2
--- scan.h      1999/08/20 06:23:12
*************** extern int skip_spaces _PARAMS((FILE *, 
*** 57,64 ****
  extern int scan_ident _PARAMS((FILE *, sstring *, int));
  extern int scan_string _PARAMS((FILE *, sstring *, int));
  extern int read_upto _PARAMS((FILE *, sstring *, int));
! extern char *xmalloc _PARAMS((unsigned));
! extern char *xrealloc _PARAMS((char *, unsigned));
  extern unsigned long hash _PARAMS((const char *));
  extern void recognized_function _PARAMS((char *, int, int, char *, int, int, char *, int));
  extern void recognized_extern _PARAMS((char *, int, char *, int));
--- 57,64 ----
  extern int scan_ident _PARAMS((FILE *, sstring *, int));
  extern int scan_string _PARAMS((FILE *, sstring *, int));
  extern int read_upto _PARAMS((FILE *, sstring *, int));
! extern PTR xmalloc _PARAMS((size_t));
! extern PTR xrealloc _PARAMS((PTR, size_t));
  extern unsigned long hash _PARAMS((const char *));
  extern void recognized_function _PARAMS((char *, int, int, char *, int, int, char *, int));
  extern void recognized_extern _PARAMS((char *, int, char *, int));

>Audit-Trail:
>Unformatted: