[patch/committed] Remove dec-C compiler warnings (VMS)

Tristan Gingold gingold@adacore.com
Thu Nov 4 13:51:00 GMT 2010


Hi,

dec-C (the native VMS compiler) doesn't like arithmetic on void * (a gcc extension), and also
detect an alias violation.  This patch remove the first issue and turn the second warning into
an informational message. (The issue is that object files are marked as generated with warnings,
which is not very elegant).

Committed on trunk.

Tristan.

bfd/
2010-11-04  Tristan Gingold  <gingold@adacore.com>

	* makefile.vms (CFLAGS): Make badalias warnings informational.
	* vms-lib.c (vms_lib_bread): Avoid arithmetic on void pointer.
 
Index: bfd/makefile.vms
===================================================================
RCS file: /cvs/src/src/bfd/makefile.vms,v
retrieving revision 1.7
diff -c -r1.7 makefile.vms
*** bfd/makefile.vms	3 Aug 2010 14:28:58 -0000	1.7
--- bfd/makefile.vms	4 Nov 2010 13:47:41 -0000
***************
*** 37,43 ****
  OPT=/noopt/debug
  CFLAGS=/name=(as_is,shortened)/include=([],"../include")\
   /define=("unlink=remove",DEBUGDIR="""GNU$$DEBUGDIR:""",$(DEFS))\
!  /warns=(infor=missingreturn)$(OPT)
  endif
  
  libbfd.olb: $(OBJS)
--- 37,43 ----
  OPT=/noopt/debug
  CFLAGS=/name=(as_is,shortened)/include=([],"../include")\
   /define=("unlink=remove",DEBUGDIR="""GNU$$DEBUGDIR:""",$(DEFS))\
!  /warns=(infor=(missingreturn,badansialias))$(OPT)
  endif
  
  libbfd.olb: $(OBJS)
Index: bfd/vms-lib.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-lib.c,v
retrieving revision 1.12
diff -c -r1.12 vms-lib.c
*** bfd/vms-lib.c	3 Aug 2010 08:49:01 -0000	1.12
--- bfd/vms-lib.c	4 Nov 2010 13:47:42 -0000
***************
*** 951,961 ****
  /* Standard IOVEC function.  */
  
  static file_ptr
! vms_lib_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
  {
    struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
    file_ptr res;
    file_ptr chunk;
  
    /* Do not read past the end.  */
    if (vec->where >= vec->file_len)
--- 951,962 ----
  /* Standard IOVEC function.  */
  
  static file_ptr
! vms_lib_bread (struct bfd *abfd, void *vbuf, file_ptr nbytes)
  {
    struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
    file_ptr res;
    file_ptr chunk;
+   unsigned char *buf = (unsigned char *)vbuf;
  
    /* Do not read past the end.  */
    if (vec->where >= vec->file_len)
***************
*** 1071,1077 ****
              }
            if (buf != NULL)
              {
!               *(unsigned char *)buf = c;
                buf++;
              }
            nbytes--;
--- 1072,1078 ----
              }
            if (buf != NULL)
              {
!               *buf = c;
                buf++;
              }
            nbytes--;



More information about the Binutils mailing list