diff mbox

c-family/c-pretty-print.c - fix for 'restrict' quliafiers

Message ID 20150817011418.GD9735@intrepid.com
State New
Headers show

Commit Message

Gary Funck Aug. 17, 2015, 1:14 a.m. UTC
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.
diff mbox

Patch

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