public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [Patch] Fix build problem with system call in compile/compile.c
@ 2015-01-06  0:44 Steve Ellcey 
  2015-01-06  3:09 ` Yao Qi
  2015-01-06  4:16 ` Joel Brobecker
  0 siblings, 2 replies; 20+ messages in thread
From: Steve Ellcey  @ 2015-01-06  0:44 UTC (permalink / raw)
  To: gdb-patches

I am building gdb (and all of binutils) on ubuntu 12.04 with GCC 4.6.3.
During compilation the gdb build fails with:

/scratch/sellcey/repos/nightly_test/src/binutils-gdb/gdb/compile/compile.c:175:10: error: ignoring return value of 'system', declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors
make[1]: *** [compile.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/scratch/sellcey/repos/nightly_test/obj-mips-img-linux-gnu/binutils-gdb/gdb'
make: *** [all-gdb] Error 2

I am not sure why other people aren't running into this but I would like to
apply this patch to fix the build problem.

OK to checkin?

Steve Ellcey
sellcey@imgtec.com


2015-01-05  Steve Ellcey  <sellcey@imgtec.com>

	* compile/compile.c (do_rmdir): Assign return value of system call.


diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 1d18bd7..f9f03f1 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -169,10 +169,12 @@ do_rmdir (void *arg)
 {
   const char *dir = arg;
   char *zap;
+  int i;
   
   gdb_assert (strncmp (dir, TMP_PREFIX, strlen (TMP_PREFIX)) == 0);
   zap = concat ("rm -rf ", dir, (char *) NULL);
-  system (zap);
+  /* GCC may generate warning if we ignore the return value of system call.  */
+  i = system (zap);
 }
 
 /* Return the name of the temporary directory to use for .o files, and

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

end of thread, other threads:[~2015-01-10  4:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-06  0:44 [Patch] Fix build problem with system call in compile/compile.c Steve Ellcey 
2015-01-06  3:09 ` Yao Qi
2015-01-06  4:16 ` Joel Brobecker
2015-01-06 16:04   ` Steve Ellcey
2015-01-07  4:14     ` Joel Brobecker
2015-01-07 18:36       ` Steve Ellcey
2015-01-07 19:01         ` Pedro Alves
2015-01-07 19:29         ` Maciej W. Rozycki
2015-01-07 19:35           ` Pedro Alves
2015-01-07 23:33             ` Maciej W. Rozycki
2015-01-08 21:12               ` Jan Kratochvil
2015-01-08 22:12                 ` Steve Ellcey
2015-01-08 23:22                   ` Pedro Alves
2015-01-09  0:10                     ` Steve Ellcey
2015-01-09  3:47                       ` Chen Gang S
2015-01-09 10:11                         ` Pedro Alves
2015-01-09 10:46                           ` Chen Gang S
2015-01-09 20:52                             ` Chen Gang S
2015-01-09 21:53                               ` Chen Gang S
2015-01-10  4:30                               ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).