bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/12739] New: [patch] bfd_get warns under -Wcast-qual


From: andersk at ksplice dot com
Subject: [Bug binutils/12739] New: [patch] bfd_get warns under -Wcast-qual
Date: Fri, 6 May 2011 23:24:03 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=12739

           Summary: [patch] bfd_get warns under -Wcast-qual
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden


This fixes bfd_get_8 (hence also bfd_get, which uses it) to accept const void *
without emitting a warning under gcc -Wcast-qual:
warning: cast discards ‘__attribute__((const))’ qualifier from pointer target
type [-Wcast-qual]

--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -431,9 +431,9 @@ DESCRIPTION
 .#define bfd_put_signed_8 \
 .  bfd_put_8
 .#define bfd_get_8(abfd, ptr) \
-.  (*(unsigned char *) (ptr) & 0xff)
+.  (*(const unsigned char *) (ptr) & 0xff)
 .#define bfd_get_signed_8(abfd, ptr) \
-.  (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
+.  (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
 .
 .#define bfd_put_16(abfd, val, ptr) \
 .  BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]