bugKawa - Bugs: bug #35524, Unreachable code is not an error

 
 

bug #35524: Unreachable code is not an error

Submitted by:  Helmut Eller <ellerh>
Submitted on:  Mon 13 Feb 2012 02:35:53 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 07 Oct 2012 06:24:11 AM UTC, comment #3:

I'm fairly happy with the unreachable-code analysis, so I closed this bug.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Fri 04 May 2012 06:10:18 AM UTC, comment #2:

I checked in a fix to make unreachable code a warning, not an error. This is somewhat risky, since I'm not sure if the code generator may get confused or produce unverifiable code.

I'm moving to detecting unreachable code at data-flow time, and then dropping unreachable expressions. There is partial support for this; what is missing is detecting infinite loops/recursion. Of course this has to be approximate: I have a vague plan for doing this, but it needs to be implemented and tested.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 13 Feb 2012 09:07:16 PM UTC, comment #1:

At the very least I think Unreachable code should be a switchable warning that defaults to being on.

However, it's not just a matter of disabling the error. The compiler and later the verifier might get confused by unreachable code. Just reporting an error is simpler for the compiler.

I'll think about it.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 13 Feb 2012 02:35:53 PM UTC, original submission:

Kawa refuses to compile code like this:

that's more annoying than helpful especially for macros:

Helmut Eller <ellerh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by ellerh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 07 Oct 2012 06:24:11 AM UTCbothnerOpen/ClosedOpen=>Closed
    Fri 04 May 2012 06:10:18 AM UTCbothnerStatusPostponed=>Fixed
    Mon 13 Feb 2012 09:07:16 PM UTCbothnerStatusNone=>Postponed
      Assigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1