This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix some warnings in libcpp


Some variables were unused and one unsigned char* to char* argument
pass.

OK? Bootstrapped on powerpc-apple-darwin with no regressions.

-- Pinski


ChangeLog: * pch.c (cpp_write_pch_state): Remove variable z as it is not used. (cpp_read_state): Remove unused variables, m, d and mac_count. Cast the first argument of strcspn to char*.

Index: pch.c
===================================================================
RCS file: /cvs/gcc/gcc/libcpp/pch.c,v
retrieving revision 1.3
diff -u -p -r1.3 pch.c
--- pch.c	22 Jun 2004 06:51:56 -0000	1.3
+++ pch.c	28 Sep 2004 14:04:58 -0000
@@ -345,8 +345,6 @@ cpp_write_pch_deps (cpp_reader *r, FILE
 int
 cpp_write_pch_state (cpp_reader *r, FILE *f)
 {
-  struct macrodef_struct z;
-
   if (!r->deps)
     r->deps = deps_init ();

@@ -630,9 +628,7 @@ int
 cpp_read_state (cpp_reader *r, const char *name, FILE *f,
 		struct save_macro_data *data)
 {
-  struct macrodef_struct m;
-  struct save_macro_item *d;
-  size_t i, mac_count;
+  size_t i;
   struct lexer_state old_state;

   /* Restore spec_nodes, which will be full of references to the old
@@ -657,7 +653,7 @@ cpp_read_state (cpp_reader *r, const cha
       size_t namelen;
       uchar *defn;

-      namelen = strcspn (data->defns[i], "( \n");
+      namelen = strcspn ((char*)data->defns[i], "( \n");
       h = cpp_lookup (r, data->defns[i], namelen);
       defn = data->defns[i] + namelen;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]