This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

Re: RFC: Patch to allow compilation by Sun cc



 > Would you both find this modification of the patch acceptable?
 > I've made the following two changes:
 > 
 >     1) Made all three versions of software_single_step use unsigned int
 >        as the first parameter (and included Paul's cast to unsigned int
 >        in the #define in all three cases).

No strong feelings, but if we actually do move the target_signal
declaration to defs.h, isn't the obvious change to modify the
definition of sparc_software_single_step in tm-sparc.h to take an 
enum target_signal as its first argument, and then not change sparc-tdep.c?

 >     2) Removed the " * sizeof (char)" from all the alloca calls, since
 >        it is never used in other contexts where these constants are sent
 >        to alloca (not to introduce a new inconsistancy).

Again, no strong feelings on this, but I am forced to disagree with
your premise.  In fact, I only decided to add this fussy pendantic
little suffix after greping the source and finding, e.g., 

breakpoint.c:5748:  blocks_searched = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
breakpoint.c:5749:  memset (blocks_searched, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
stack.c:1376:  blocks_printed = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
stack.c:1377:  memset (blocks_printed, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
varobj.c:1246:				  * sizeof (char));
varobj.c:1821:	name = (char *) xmalloc (1 + len * sizeof (char));
varobj.c:1842:	  name = (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
win32-nat.c:539:      DWORD size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);

... and then trying to be consistent (:->).  But, as I say, no strong
preference. 

Paul


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