If no negative effect with keeping code clear and simple, need try to
avoid warning, especially use our own 'xgcc' for our own code. The
related warning under Darwin is:

  /var/root/upstream/build-gcc-new/./gcc/xgcc 
-B/var/root/upstream/build-gcc-new/./gcc/ 
-B/usr/local/x86_64-apple-darwin13.4.0/bin/ 
-B/usr/local/x86_64-apple-darwin13.4.0/lib/ -isystem 
/usr/local/x86_64-apple-darwin13.4.0/include -isystem 
/usr/local/x86_64-apple-darwin13.4.0/sys-include    -g -O2 -m32 -O2  -g -O2 
-DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format 
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem 
./include   -pipe -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc 
-fno-stack-protector   -pipe -fno-common -I. -I. -I../../.././gcc 
-I../../../../gcc-new/libgcc -I../../../../gcc-new/libgcc/. 
-I../../../../gcc-new/libgcc/../gcc -I../../../../gcc-new/libgcc/../include  
-DHAVE_CC_TLS -DUSE_EMUTLS -o unwind-dw2-fde-darwin_s.o -MT 
unwind-dw2-fde-darwin_s.o -MD -MP -MF unwind-dw2-fde-darwin_s.dep -DSHARED 
-fexceptions -c ../../../../gcc-new/libgcc/config/unwind-dw2-fde-darwin.c
  In file included from 
../../../../gcc-new/libgcc/config/unwind-dw2-fde-darwin.c:35:0:
  ../../../../gcc-new/libgcc/unwind-dw2-fde.h: In function 'last_fde':
  ../../../../gcc-new/libgcc/unwind-dw2-fde.h:172:10: warning: cast discards 
'const' qualifier from pointer target type [-Wcast-qual]
     return (char *)f == obj->fde_end || f->length == 0;
                  ^

It passes "make -k check" under Darwin x86_64.

2014-10-07  Chen Gang  <gang.chen.5...@gmail.com>

        * unwind-dw2-fde.h (last_fde): Use "(const fde *)" instead of
        "(char *)" to avoid qualifier warning by 'xgcc' compiling.
---
 libgcc/unwind-dw2-fde.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/unwind-dw2-fde.h b/libgcc/unwind-dw2-fde.h
index c8201c6..8a71aa6 100644
--- a/libgcc/unwind-dw2-fde.h
+++ b/libgcc/unwind-dw2-fde.h
@@ -169,7 +169,7 @@ static inline int
 last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f)
 {
 #ifdef DWARF2_OBJECT_END_PTR_EXTENSION
-  return (char *)f == obj->fde_end || f->length == 0;
+  return f == (const fde *) obj->fde_end || f->length == 0;
 #else
   return f->length == 0;
 #endif
-- 
1.8.5.2 (Apple Git-48)

Reply via email to