public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: aesthetics for gcc/cp/cxx-pretty-print.c
@ 2011-06-06  2:18 Bruce Korb
  2011-06-06  4:31 ` Basile Starynkevitch
  2011-06-07 16:01 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Bruce Korb @ 2011-06-06  2:18 UTC (permalink / raw)
  To: GCC Patches

It also caused a code analysis tool to wander off into the weeds.

2011-06-05  Bruce Korb  <bkorb@gnu.org>

	* gcc/cp/cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Do not have a switch
	label pointing into an "else" clause for an "if".

Index: gcc/cp/cxx-pretty-print.c
===================================================================
--- gcc/cp/cxx-pretty-print.c	(revision 174678)
+++ gcc/cp/cxx-pretty-print.c	(working copy)
@@ -1199,13 +1199,16 @@

      case FUNCTION_DECL:
        /* Constructors don't have return types.  And conversion functions
-	 do not have a type-specifier in their return types.  */
+         do not have a type-specifier in their return types.  */
+
        if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t))
-	pp_cxx_function_specifier (pp, t);
-      else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
-	pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t)));
-      else
-	default:
+        pp_cxx_function_specifier (pp, t), break;
+
+      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+        pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))), break;
+      /* FALLTHROUGH */
+
+    default:
        pp_c_declaration_specifiers (pp_c_base (pp), t);
        break;
      }

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

* Re: Patch: aesthetics for gcc/cp/cxx-pretty-print.c
  2011-06-06  2:18 Patch: aesthetics for gcc/cp/cxx-pretty-print.c Bruce Korb
@ 2011-06-06  4:31 ` Basile Starynkevitch
  2011-06-07 16:01 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Basile Starynkevitch @ 2011-06-06  4:31 UTC (permalink / raw)
  To: Bruce Korb; +Cc: GCC Patches

On Sun, 05 Jun 2011 19:17:48 -0700
Bruce Korb <bruce.korb@gmail.com> wrote:

> It also caused a code analysis tool to wander off into the weeds.
> +      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
> +        pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))), break;
> +      /* FALLTHROUGH */


I believe the usual GCC style is using braces, e.g

      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
        {
          pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t)));
          break;
        }
      /* FALLTHROUGH */


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

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

* Re: Patch: aesthetics for gcc/cp/cxx-pretty-print.c
  2011-06-06  2:18 Patch: aesthetics for gcc/cp/cxx-pretty-print.c Bruce Korb
  2011-06-06  4:31 ` Basile Starynkevitch
@ 2011-06-07 16:01 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2011-06-07 16:01 UTC (permalink / raw)
  To: Bruce Korb; +Cc: GCC Patches

On 06/06/2011 04:17 AM, Bruce Korb wrote:
> It also caused a code analysis tool to wander off into the weeds.

And "x, break;" didn't? :)

(First time I see it, I swear).

Paolo

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

end of thread, other threads:[~2011-06-07 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-06  2:18 Patch: aesthetics for gcc/cp/cxx-pretty-print.c Bruce Korb
2011-06-06  4:31 ` Basile Starynkevitch
2011-06-07 16:01 ` Paolo Bonzini

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).