troubling warnings on alpha

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Nov 30 23:39:00 GMT 1999


 > From: Brad Lucier <lucier@math.purdue.edu>
 >  
 > The following warnings in today's mainline caught my eye because
 > they often spell trouble on the alpha, where pointers are 64bits
 > and ints are 32 bits.  Here they don't seem to be real coding
 > errors, but it would be good to modify things to get rid of them:
 >  
 >  [...]
 >  
 > Also, the following warnings are troubling; can includes be added to
 > get the proper declarations?
 >  
 > ../../libiberty/hashtab.c: In function `create_hash_table':
 > ../../libiberty/hashtab.c:115: warning: type mismatch in implicit
 > declaration fo
 > r built-in function `memset'
 >  
 > ../../libiberty/xmemdup.c: In function `xmemdup':
 > ../../libiberty/xmemdup.c:20: warning: type mismatch in implicit
 > declaration for
 >  built-in function `memcpy'


IMHO, the libiberty needs a system.h.  It makes no sense to do these
fixes to individual files multiple times.  This is on my list of
things to-do eventually.  (Probably in December I'll have time for gcc
stuff again.)



 > ../../gcc/libgcc2.c: In function `new_eh_context':
 > ../../gcc/libgcc2.c:3090: warning: type mismatch in implicit
 > declaration for built-in function `memset'
 > ../../gcc/libgcc2.c:3668: warning: type mismatch in implicit
 > declaration for built-in function `memcpy'
 >  
 > ../../gcc/frame.c: In function `extract_cie_info':
 > ../../gcc/frame.c:580: warning: type mismatch in implicit declaration
 > for built-in function `strlen'
 > ../../gcc/frame.c: In function `execute_cfa_insn':
 > ../../gcc/frame.c:700: warning: type mismatch in implicit declaration
 > for built-in function `memcpy'
 > ../../gcc/frame.c: In function `__frame_state_for':
 > ../../gcc/frame.c:846: warning: type mismatch in implicit declaration
 > for built-in function `memset'
 >  
 > Brad Lucier   

I think for this stuff, we should include string.h (and others files
like stdio.h/errno.h/time.h) in frame.c and libgcc2.c.

We have to be careful since there is no guarantee that these files
exist on the target platform.  At a minimum, they should be wrapped by
#ifndef inhibit_libc like we do for stdlib.h and unistd.h.

There are some headers which we have been including unconditionally in
system.h for ages, so these at least should be safe to include here as
long as we honor `inhibit_libc'.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions



More information about the Gcc-bugs mailing list