This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libiberty warning patch
- To: egcs-patches at egcs dot cygnus dot com
- Subject: libiberty warning patch
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 4 Aug 1999 11:03:29 -0400 (EDT)
The following warnings from the gcc directory:
> cxxmain.c: In function `gnu_special':
> cxxmain.c:2451: warning: comparison between signed and unsigned
> cxxmain.c: In function `arm_special':
> cxxmain.c:2618: warning: comparison between signed and unsigned
> cxxmain.c: In function `demangle_fund_type':
> cxxmain.c:3384: warning: comparison between signed and unsigned
> cxxmain.c: In function `do_hpacc_template_const_value':
> cxxmain.c:3453: warning: unused parameter `work'
> cxxmain.c: In function `main':
> cxxmain.c:4527: warning: assignment discards qualifiers from pointer
> target type
> cxxmain.c:4530: warning: assignment discards qualifiers from pointer
> target type
are due to the file libiberty/cplus-dem.c, (which cxxmain.c is a
symlink to.)
Here is a patch to clean them up. Note libiberty has the ATTRIBUTE_*
stuff now so its safe to use in a file compiled in both directories.
Okay to install?
Thanks,
--Kaveh
1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cplus-dem.c (gnu_special): Cast a `size_t' to `long' when
comparing against a signed quantity.
(arm_special): Likewise.
(demangle_fund_type): Likewise.
(do_hpacc_template_const_value): Mark parameter `work' with
ATTRIBUTE_UNUSED.
(main): Constify variable `valid_symbols'.
diff -rup orig/egcs-CVS19990803/libiberty/cplus-dem.c egcs-CVS19990803/libiberty/cplus-dem.c
--- orig/egcs-CVS19990803/libiberty/cplus-dem.c Mon May 17 09:13:21 1999
+++ egcs-CVS19990803/libiberty/cplus-dem.c Wed Aug 4 10:42:46 1999
@@ -2448,7 +2448,7 @@ gnu_special (work, mangled, declp)
break;
default:
n = consume_count (mangled);
- if (n < 0 || n > strlen (*mangled))
+ if (n < 0 || n > (long) strlen (*mangled))
{
success = 0;
break;
@@ -2615,7 +2615,7 @@ arm_special (mangled, declp)
{
n = consume_count (mangled);
if (n == -1
- || n > strlen (*mangled))
+ || n > (long) strlen (*mangled))
return 0;
string_prependn (declp, *mangled, n);
(*mangled) += n;
@@ -3381,7 +3381,7 @@ demangle_fund_type (work, mangled, resul
int i;
(*mangled)++;
for (i = 0;
- i < sizeof (buf) - 1 && **mangled && **mangled != '_';
+ i < (long) sizeof (buf) - 1 && **mangled && **mangled != '_';
(*mangled)++, i++)
buf[i] = **mangled;
if (**mangled != '_')
@@ -3450,7 +3450,7 @@ demangle_fund_type (work, mangled, resul
static int
do_hpacc_template_const_value (work, mangled, result)
- struct work_stuff *work;
+ struct work_stuff *work ATTRIBUTE_UNUSED;
const char **mangled;
string *result;
{
@@ -4451,7 +4451,7 @@ main (argc, argv)
{
char *result;
int c;
- char *valid_symbols;
+ const char *valid_symbols;
program_name = argv[0];