From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2099 invoked by alias); 19 Oct 2012 16:17:19 -0000 Received: (qmail 1900 invoked by uid 22791); 19 Oct 2012 16:17:14 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Fri, 19 Oct 2012 16:17:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9JGH4e9019083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Oct 2012 12:17:04 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9JGGxsc028197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 19 Oct 2012 12:17:01 -0400 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: RFC: fix bug in compare_breakpoints References: <87sj9c28o1.fsf@fleche.redhat.com> <507FC362.5070906@redhat.com> <87lif3y27l.fsf@fleche.redhat.com> Date: Fri, 19 Oct 2012 16:17:00 -0000 In-Reply-To: <87lif3y27l.fsf@fleche.redhat.com> (Tom Tromey's message of "Thu, 18 Oct 2012 14:06:38 -0600") Message-ID: <87lif2wi6c.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-10/txt/msg00349.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> The other problem is caught by -Wempty-body, which we don't enable. It Tom> yields a number of warnings and would require a coding style change Tom> from: [...] FWIW, here's the patch. Comments appreciated. I do think it is a mild improvement. It is a lot easier to mistype a ";" than a correctly formatted brace pair. I left out the rs6000-aix-tdep.c part of the patch since it is being addressed separately. Tom * configure: Rebuild. * configure.ac (build_warnings): Add -Wempty-body. * m68k-tdep.c (m68k_gdbarch_init): Remove empty 'if'. * remote.c (handle_notification): Use braces for empty 'else' body. * s390-tdep.c (s390_analyze_prologue): Use braces for empty 'else' body. * sh64-tdep.c (sh64_push_dummy_call): Use braces for empty 'else' body. * solib-som.c (som_relocate_section_addresses): Use braces for empty 'else' body. * ui-file.c (stdio_file_write): Use braces for empty 'if' body. (stdio_file_write_async_safe, stdio_file_fputs): Likewise. diff --git a/gdb/configure.ac b/gdb/configure.ac index fc181fd..f0b7df3 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1920,7 +1920,7 @@ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ -Wformat-nonliteral -Wno-pointer-sign \ -Wno-unused -Wunused-value -Wunused-function \ -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \ --Wdeclaration-after-statement" +-Wdeclaration-after-statement -Wempty-body" # Enable -Wno-format by default when using gcc on mingw since many # GCC versions complain about %I64. diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index b45a80f..0bad9ac 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1100,9 +1100,6 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) feature = tdesc_find_feature (info.target_desc, "org.gnu.gdb.m68k.core"); - if (feature != NULL) - /* Do nothing. */ - ; if (feature == NULL) { diff --git a/gdb/remote.c b/gdb/remote.c index 1750bee..2ed5501 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6781,9 +6781,10 @@ handle_notification (char *buf) } } else - /* We ignore notifications we don't recognize, for compatibility - with newer stubs. */ - ; + { + /* We ignore notifications we don't recognize, for compatibility + with newer stubs. */ + } } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 6cd6fd4..0af6f51 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1461,13 +1461,14 @@ s390_analyze_prologue (struct gdbarch *gdbarch, break; else - /* An instruction we don't know how to simulate. The only - safe thing to do would be to set every value we're tracking - to 'unknown'. Instead, we'll be optimistic: we assume that - we *can* interpret every instruction that the compiler uses - to manipulate any of the data we're interested in here -- - then we can just ignore anything else. */ - ; + { + /* An instruction we don't know how to simulate. The only + safe thing to do would be to set every value we're tracking + to 'unknown'. Instead, we'll be optimistic: we assume that + we *can* interpret every instruction that the compiler uses + to manipulate any of the data we're interested in here -- + then we can just ignore anything else. */ + } /* Record the address after the last instruction that changed the FP, SP, or backlink. Ignore instructions that changed diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 4e6f262..e11e746 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -1175,10 +1175,10 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, int_argreg ++; } else - ; - /* Store it as the integers, 8 bytes at the time, if - necessary spilling on the stack. */ - + { + /* Store it as the integers, 8 bytes at the time, if + necessary spilling on the stack. */ + } } else if (len == 8) { @@ -1202,9 +1202,10 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, int_argreg ++; } else - ; - /* Store it as the integers, 8 bytes at the time, if - necessary spilling on the stack. */ + { + /* Store it as the integers, 8 bytes at the time, if + necessary spilling on the stack. */ + } } } } diff --git a/gdb/solib-som.c b/gdb/solib-som.c index 6100cbe..6fea108 100644 --- a/gdb/solib-som.c +++ b/gdb/solib-som.c @@ -126,7 +126,9 @@ som_relocate_section_addresses (struct so_list *so, sec->endaddr += so->lm_info->data_start; } else - ; + { + /* Nothing. */ + } } diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 8528793..68089e6 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -561,7 +561,9 @@ stdio_file_write (struct ui_file *file, const char *buf, long length_buf) _("stdio_file_write: bad magic number")); /* Calling error crashes when we are called from the exception framework. */ if (fwrite (buf, length_buf, 1, stdio->file)) - ; + { + /* Nothing. */ + } } static void @@ -583,7 +585,9 @@ stdio_file_write_async_safe (struct ui_file *file, result of write (since it can be declared with attribute warn_unused_result). Alas casting to void doesn't work for this. */ if (write (stdio->fd, buf, length_buf)) - ; + { + /* Nothing. */ + } } static void @@ -596,7 +600,9 @@ stdio_file_fputs (const char *linebuffer, struct ui_file *file) _("stdio_file_fputs: bad magic number")); /* Calling error crashes when we are called from the exception framework. */ if (fputs (linebuffer, stdio->file)) - ; + { + /* Nothing. */ + } } static int