[committed]: Fix compile time warnings building vms-misc.c

Nick Clifton nickc@redhat.com
Fri May 28 12:24:00 GMT 2010


Hi Guys,

  I am checking in the patch below to remove a couple of compile time
  warnings about useless shifts when compiling vms-misc.c on a host with
  a 32-bit time_t type.

Cheers
  Nick

bfd/ChangeLog
2010-05-28  Nick Clifton  <nickc@redhat.com>

	* vms-misc.c (vms_time_t_to_vms_time): Fix compile time warning
	about seal's shifts.

Index: bfd/vms-misc.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-misc.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 vms-misc.c
*** bfd/vms-misc.c	27 May 2010 13:43:44 -0000	1.35
--- bfd/vms-misc.c	28 May 2010 12:22:00 -0000
*************** vms_time_t_to_vms_time (time_t ut, unsig
*** 587,594 ****
    val[1] = (ut >> 16) & 0xffff;
    if (sizeof (ut) > 4)
      {
!       val[2] = (ut >> 32) & 0xffff;
!       val[3] = (ut >> 48) & 0xffff;
      }
    else
      {
--- 587,596 ----
    val[1] = (ut >> 16) & 0xffff;
    if (sizeof (ut) > 4)
      {
!       /* The shifts are expressed this way to avoid
! 	 compile time warnings when sizeof (ut) <= 4.  */
!       val[2] = ((ut >> 16) >> 16) & 0xffff;
!       val[3] = (((ut >> 16) >> 16) >> 16) & 0xffff;
      }
    else
      {



More information about the Binutils mailing list