Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4113193

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

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.2.0
    • 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: