Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] cleanup: Wunused corefile.c
@ 2013-01-31 19:36 Aleksandar Ristovski
  2013-01-31 20:24 ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Aleksandar Ristovski @ 2013-01-31 19:36 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

Hello,

In addition to already posted/committed Wunused I have a bunch of 
patches which work around unused vars by adding attribute unused.

Rationale was: either it was unclear whether the assignment might have 
side-effects or there was something that should have been done (e.g. 
this case) with the variable.

Let me know if this is acceptable approach.

Thank you,

Aleksandar Ristovski
QNX Software Systems


ChangeLog:

         * corefile.c (reopen_exec_file): Add unused attribute to res,
         add FIXME comment for future cleanup.

[-- Attachment #2: Wunused-corefile-201301311429.patch --]
[-- Type: text/x-patch, Size: 755 bytes --]

Index: gdb/corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.71
diff -u -p -r1.71 corefile.c
--- gdb/corefile.c	14 Jan 2013 21:03:54 -0000	1.71
+++ gdb/corefile.c	30 Jan 2013 22:25:14 -0000
@@ -136,7 +136,7 @@ void
 reopen_exec_file (void)
 {
   char *filename;
-  int res;
+  int res __attribute__ ((unused));
   struct stat st;
   struct cleanup *cleanups;
 
@@ -149,6 +149,8 @@ reopen_exec_file (void)
   cleanups = make_cleanup (xfree, filename);
   res = stat (filename, &st);
 
+  /* FIXME: error checking using 'res' (and remove attribute unused).  */
+
   if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime)
     exec_file_attach (filename, 0);
   else



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-03  0:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 19:36 [patch] cleanup: Wunused corefile.c Aleksandar Ristovski
2013-01-31 20:24 ` Tom Tromey
2013-01-31 20:29   ` Aleksandar Ristovski
2013-02-01 21:16     ` Tom Tromey
2013-02-01 21:31       ` Aleksandar Ristovski
2013-02-01 21:54         ` Aleksandar Ristovski
2013-02-03  0:05           ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox