From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4187 invoked by alias); 18 Dec 2011 19:22:58 -0000 Received: (qmail 4179 invoked by uid 22791); 18 Dec 2011 19:22:58 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 18 Dec 2011 19:22:45 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBIJMihd018623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 18 Dec 2011 14:22:44 -0500 Received: from host2.jankratochvil.net (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pBIJMe08007914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 18 Dec 2011 14:22:42 -0500 Date: Sun, 18 Dec 2011 20:58:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches ml Subject: Re: [OB] Fix linux-low.c build error Message-ID: <20111218192239.GA25401@host2.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00612.txt.bz2 On Sun, 18 Dec 2011 16:49:43 +0100, Hui Zhu wrote: > Got: > gcc -c -g -O2 -I. -I../../../src/gdb/gdbserver > -I../../../src/gdb/gdbserver/../common > -I../../../src/gdb/gdbserver/../regformats > -I../../../src/gdb/gdbserver/../../include -Wall > -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral > -Wno-char-subscripts -Werror ../../../src/gdb/gdbserver/linux-low.c > -DUSE_THREAD_DB > cc1: warnings being treated as errors > ../../../src/gdb/gdbserver/linux-low.c: In function ‘linux_create_inferior’: > ../../../src/gdb/gdbserver/linux-low.c:580:10: error: ignoring return > value of ‘write’, declared with attribute warn_unused_result (a) Please do not wrap the lines, it is very unreadable this way. (b) Please write down the GCC version you used. I do not see such behavior at any of the FSF GCC versions FSF: gcc (GCC) 4.4.7 20111218 (prerelease) FSF: gcc (GCC) 4.5.4 20111218 (prerelease) FSF: gcc (GCC) 4.6.3 20111218 (prerelease) FSF: gcc (GCC) 4.7.0 20111218 (experimental) nor at Fedora GCC versions such as gcc-4.6.2-1.fc17.1.x86_64. (c) With these GCCs FSF: gcc (GCC) 4.6.3 20111218 (prerelease) FSF: gcc (GCC) 4.7.0 20111218 (experimental) gcc-4.6.2-1.fc17.1.x86_64 gcc-4.6.2-1.fc16.x86_64 gcc-4.6.1-9.fc15.x86_64 (older Fedoras are EOLed) it errors with: gcc -c -m64 -ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -I. -I. -I./../common -I./../regformats -I./../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror linux-low.c -DUSE_THREAD_DB linux-low.c: In function ‘linux_create_inferior’: linux-low.c:577:8: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors This is a regression. (d) Please do not push changes needed for any obsolete and/or broken vendor compilers into FSF GDB. I really have (or had) a ton of patches specific to Fedoras, I do not push them to FSF GDB. They should stay at vendor GDB branches. Please revert the patch or fix it or FSF GCC >= 4.6. Thanks, Jan > --- src/gdb/gdbserver/linux-low.c 2011/12/16 19:06:37 1.185 > +++ src/gdb/gdbserver/linux-low.c 2011/12/18 15:49:04 1.186 > @@ -574,11 +574,12 @@ > Also, redirect stdin to /dev/null. */ > if (remote_connection_is_stdio ()) > { > + int ret; Here should be empty line, between declarations and code. > close (0); > open ("/dev/null", O_RDONLY); > dup2 (2, 1); > - write (2, "stdin/stdout redirected\n", > - sizeof ("stdin/stdout redirected\n") - 1); > + ret = write (2, "stdin/stdout redirected\n", > + sizeof ("stdin/stdout redirected\n") - 1); > } > > execv (program, allargs);