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: Patch to create builtin bzero


 > From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
 > 
 >  > From: Jason Merrill <jason@cygnus.com>
 >  > 
 >  > This patch:
 >  > 
 >  > 2000-03-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 >  > 
 >  > 	* c-common.c (c_common_nodes_and_builtins): Don't special case
 >  > 	cplus_mode when declaring builtin bzero/bcmp, always avoid
 >  > 	prototype arguments.
 >  > 
 >  > breaks C++; when we include /usr/include/string.h, the compiler
 >  > complains about mismatching declarations.  
 > 
 > 
 > Jason, would you please tell me what platform and show me your code
 > and the error message?  The whole point of the patch was to avoid
 > mentioning the args so conflicts wouldn't occur.  I'm curious what's
 > going on, only __builtin_{bzero,bcmp} get args, not regular bzero or
 > bcmp.  Are you using the __builtin_* calls or the regular ones?


Jason, are you still having a problem with the bzero/bcmp builtins?


After some more testing I've been able to get C++ to complain, but
only when using -pedantic.  I don't know if this is the same situation
you ran into.

E.g.:

 > new declaration `void bzero (void *, unsigned int)' ambiguates
 > built-in declaration `void bzero (...)'

This doesn't happen if you use "-ansi -pedantic", because these
builtins are not activated when using -ansi.  (That's why the
testsuite passes.)  It only occurs if you use -pedantic or
-pedantic-errors without -ansi.

I can submit a patch to correct the pedantic situation if you wish.
It would essentially deactivate the builtins in g++ if pedantic is
set.


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

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