Issue compile-time warning on empty loop body: "for (...);", "while (...);" etc

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P5
    • None
    • Affects Version/s: 1.2.0
    • Component/s: tools
    • x86
    • windows_nt



      Name: tb29552 Date: 02/18/98



      Whenever the compiler sees either of
         for (...);
      or
         while (...);
      couldn't it produce a warning insisting on
      at least a 'continue' statement as the
      loop body. This would make a very popular
      programming mistake much harder to write.
      (I think 'do; while (...);' is safe enough.)

      Warning: loop statment with empty body.
               Change it to 'for (...) continue;'
               or 'while (...) continue;'
               if this was intentional.
      (Review ID: 25285)
      ======================================================================

            Assignee:
            David Stoutamire (Inactive)
            Reporter:
            Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: