From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21082 invoked by alias); 27 Aug 2010 10:29:18 -0000 Received: (qmail 21070 invoked by uid 22791); 27 Aug 2010 10:29:16 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,TW_SX,T_RP_MATCHES_RCVD,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Aug 2010 10:29:11 +0000 Received: (qmail 28436 invoked from network); 27 Aug 2010 10:29:10 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Aug 2010 10:29:10 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: build gdbserver with -Werror by default Date: Fri, 27 Aug 2010 10:29:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: "Pierre Muller" References: <201008261917.51934.pedro@codesourcery.com> <001e01cb45c5$a6b53b40$f41fb1c0$@muller@ics-cnrs.unistra.fr> In-Reply-To: <001e01cb45c5$a6b53b40$f41fb1c0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008271129.08333.pedro@codesourcery.com> 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: 2010-08/txt/msg00458.txt.bz2 On Friday 27 August 2010 09:55:11, Pierre Muller wrote: > Hi Pedro, > > Cygwin 1.7 fails on gdbserver: > gcc -c -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral - > Werror -gstabs+ -O0 -I. -I../../../src/gdb/gdbserver -I../../../src/gdb/gdbse > rver/../common -I../../../src/gdb/gdbserver/../regformats -I../../../src/gdb/gdb > server/../../include ../../../src/gdb/gdbserver/tracepoint.c > cc1: warnings being treated as errors > ../../../src/gdb/gdbserver/tracepoint.c: In function `add_tracepoint_action': > ../../../src/gdb/gdbserver/tracepoint.c:1870: error: array subscript has type `c > har' > make[3]: *** [tracepoint.o] Error 1 > > isxdigit argument type is int, not char according to man page... > Adding an explicit typecast to int at that line > allows to go to compilation of win32-low.c, and it'd fail elsewhere if it kept going, most probably. GDB has a bunch of suspicious code like this as well (e.g., in remote.c), so it ended up with -Wno-char-subscripts. I didn't bring that warning over to gdbserver, as I didn't see any warning when building for linux and mingw32, so I thought it was unnecessary (it is probably gcc version dependent whether that's part of -Wall). Since this is certainly not a new warning (it's the fact that it causes an error that it's new) I've now added -Wno-char-subscripts to gdbserver as well... > but there you > end up with warnings about deprecated functions... > To fix that, you would need to use the same kind of macros > as in gdb/windows-nat.c Hmm, I have no clue about what deprecated warnings are these, and what macros you're talking about. Are these new warnings, or it is just that they've been there before, but ignored? -- Pedro Alves 2010-08-27 Pedro Alves * configure.ac (build_warnings): Add -Wno-char-subscripts. * configure: Regenerate. --- gdb/gdbserver/configure | 2 +- gdb/gdbserver/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: src/gdb/gdbserver/configure.ac =================================================================== --- src.orig/gdb/gdbserver/configure.ac 2010-08-26 19:32:03.000000000 +0100 +++ src/gdb/gdbserver/configure.ac 2010-08-27 11:02:56.000000000 +0100 @@ -112,7 +112,7 @@ if test "${ERROR_ON_WARNING}" = yes ; th fi build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral " +-Wformat-nonliteral -Wno-char-subscripts" WARN_CFLAGS="" if test "x$GCC" = xyes Index: src/gdb/gdbserver/configure =================================================================== --- src.orig/gdb/gdbserver/configure 2010-08-26 19:32:03.000000000 +0100 +++ src/gdb/gdbserver/configure 2010-08-27 11:03:45.000000000 +0100 @@ -3944,7 +3944,7 @@ if test "${ERROR_ON_WARNING}" = yes ; th fi build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral " +-Wformat-nonliteral -Wno-char-subscripts" WARN_CFLAGS="" if test "x$GCC" = xyes