public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* c-family/c-pretty-print.c - fix for 'restrict' quliafiers
@ 2015-08-17  2:35 Gary Funck
  2015-08-17 10:49 ` Marek Polacek
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Funck @ 2015-08-17  2:35 UTC (permalink / raw)
  To: Gcc Patches; +Cc: Nenad Vukicevic


While reviewing some code, I noticed that the logic for
pretty-printing 'restrict' qualifiers is likely missing a
statement that sets 'previous'.

OK to commit?

2015-08-l6  Gary Funck  <gary@intrepid.com>

        * c-pretty-print.c (pp_c_cv_qualifiers):
        Set 'previous' for restrict qualifiers.

Index: c-pretty-print.c
===================================================================
--- c-pretty-print.c    (revision 226928)
+++ c-pretty-print.c    (working copy)
@@ -207,16 +207,17 @@ pp_c_cv_qualifiers (c_pretty_printer *pp
     }
 
   if (qualifiers & TYPE_QUAL_RESTRICT)
     {
       if (previous)
         pp_c_whitespace (pp);
       pp_c_ws_string (pp, (flag_isoc99 && !c_dialect_cxx ()
                           ? "restrict" : "__restrict__"));
+      previous = true;
     }
 }
 
 /* Pretty-print T using the type-cast notation '( type-name )'.  */
 
 static void
 pp_c_type_cast (c_pretty_printer *pp, tree t)
 {


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

end of thread, other threads:[~2015-08-17 14:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-17  2:35 c-family/c-pretty-print.c - fix for 'restrict' quliafiers Gary Funck
2015-08-17 10:49 ` Marek Polacek
2015-08-17 12:46   ` Gary Funck
2015-08-17 13:12   ` Marek Polacek
2015-08-17 14:14     ` Jason Merrill

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