This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] cris-elf compiler warnings
- To: Orjan Friberg <orjanf at axis dot com>
- Subject: [patch] cris-elf compiler warnings
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Sat, 28 Jul 2001 17:13:34 -0400
- Cc: gdb-patches at sources dot redhat dot com
Just FYI,
When compiling cris-tdep.c on a PowerPC host:
gcc -c -g -O -I. -I/home/scratch/GDB/src/gdb
-I/home/scratch/GDB/src/gdb/config -DHAVE_CONFIG_H
-I/home/scratch/GDB/src/gdb/../include/opcode
-I/home/scratch/GDB/src/gdb/../readline/.. -I../bfd
-I/home/scratch/GDB/src/gdb/../bfd
-I/home/scratch/GDB/src/gdb/../include -I../intl
-I/home/scratch/GDB/src/gdb/../intl -DMI_OUT=1 -DUI_OUT=1 -Wimplicit
-Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses
-Wpointer-arith -Wuninitialized /home/scratch/GDB/src/gdb/cris-tdep.c
/home/scratch/GDB/src/gdb/cris-tdep.c: In function `cris_examine':
/home/scratch/GDB/src/gdb/cris-tdep.c:557: warning: comparison is always
0 due to limited range of data type
/home/scratch/GDB/src/gdb/cris-tdep.c:605: warning: comparison is always
0 due to limited range of data type
/home/scratch/GDB/src/gdb/cris-tdep.c: In function `cris_register_name':
/home/scratch/GDB/src/gdb/cris-tdep.c:1012: warning: return discards
`const' from pointer target type
/home/scratch/GDB/src/gdb/cris-tdep.c: In function
`reg_mode_add_sub_cmp_and_or_move_op':
/home/scratch/GDB/src/gdb/cris-tdep.c:3054: warning: `operand1' might be
used uninitialized in this function
Looking at them:
The signed vs unsigned is because the PowerPC has an _unsigned_ char.
The code needs to use ``signed char'' rather than just ``char''.
The ``const char *'' to ``char *'' cast is really a bug in the current
register_name() function signature. It should return ``const char *'.
Given this affects gdbarch.{sh,h,c} I'm not going to try fixing it for 5.1.
The ``operand1'' uninitialized looks like a real bug.
I've tweekd the MAINTAINERS file per the attached.
Andrew
2001-07-28 Andrew Cagney <ac131313@redhat.com>
* MAINTAINERS (cris): Set --enable-gdb-build-warnings flag to -w.
Index: MAINTAINERS
===================================================================
RCS file: /cvs/src/src/gdb/MAINTAINERS,v
retrieving revision 1.113
diff -p -r1.113 MAINTAINERS
*** MAINTAINERS 2001/07/28 20:23:53 1.113
--- MAINTAINERS 2001/07/28 20:58:01
*************** maintainer works with the native maintai
*** 61,67 ****
Fernando Nasser fnasser@redhat.com
Scott Bambrough scottb@netwinder.org
! cris --target=cris-elf ,-Werror
Orjan Friberg orjanf@axis.com
d10v --target=d10v-elf ,-Werror
--- 61,67 ----
Fernando Nasser fnasser@redhat.com
Scott Bambrough scottb@netwinder.org
! cris --target=cris-elf -w
Orjan Friberg orjanf@axis.com
d10v --target=d10v-elf ,-Werror