This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bracing errors in gcc/except.c?


  While doing builds of gcc trunk with --enable-build-with-cxx, the g++ compiler
triggers some warnings not seen with the stock build. In particular, I see...

g++ -c  -g -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6-20110116/gcc -I../../gcc-4.6-20110116/gcc/. -I../../gcc-4.6-20110116/gcc/../include -I../../gcc-4.6-20110116/gcc/../libcpp/include -I/sw/include -I/sw/include  -I../../gcc-4.6-20110116/gcc/../libdecnumber -I../../gcc-4.6-20110116/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include  -I/sw/include -DCLOOG_INT_GMP -DCLOOG_ORG -I/sw/include ../../gcc-4.6-20110116/gcc/fixed-value.c -o fixed-value.o
../../gcc-4.6-20110116/gcc/except.c: In function 'void dump_eh_tree(FILE*, function*)':
../../gcc-4.6-20110116/gcc/except.c:3197: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
../../gcc-4.6-20110116/gcc/dwarf2out.c: In function 'void output_die(die_struct*)':
../../gcc-4.6-20110116/gcc/dwarf2out.c:11184: warning: format not a string literal and no format arguments

where we have...

      if (i->landing_pads)
        {
          eh_landing_pad lp;

          fprintf (out, " land:");
          if (current_ir_type () == IR_GIMPLE)
            {
              for (lp = i->landing_pads; lp ; lp = lp->next_lp)
                {
                  fprintf (out, "{%i,", lp->index);
                  print_generic_expr (out, lp->post_landing_pad, 0);
                  fputc ('}', out);
                  if (lp->next_lp)
                    fputc (',', out);
                }
            }
          else
            {
              for (lp = i->landing_pads; lp ; lp = lp->next_lp);
                {
                  fprintf (out, "{%i,", lp->index);
                  if (lp->landing_pad)
                    fprintf (out, "%i%s,", INSN_UID (lp->landing_pad),
                             NOTE_P (lp->landing_pad) ? "(del)" : "");
                  else
                    fprintf (out, "(nil),");
                  if (lp->post_landing_pad)
                    {
                      rtx lab = label_rtx (lp->post_landing_pad);
                      fprintf (out, "%i%s}", INSN_UID (lab),
                               NOTE_P (lab) ? "(del)" : "");
                    }
                  else
                    fprintf (out, "(nil)}");
                  if (lp->next_lp)
                    fputc (',', out);
                }
            }
        }

The unnecessary bracing immediately after...

              for (lp = i->landing_pads; lp ; lp = lp->next_lp);

seems odd (as if the line above has accidentally gotten a ';' added).
Is there a coding error here?
               Jack


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]