public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/17157] New: GCJ does not give an error for checked exceptions that are never thrown
@ 2004-08-23 22:11 csm at gnu dot org
  2004-08-23 22:15 ` [Bug java/17157] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: csm at gnu dot org @ 2004-08-23 22:11 UTC (permalink / raw)
  To: java-prs

GCJ does not reject a 'try { } catch (foo) { }' construction where a checked
exception 'foo' can never be thrown within the 'try' block.

As an example of this, javac and jikes both give an error for the following
program, while GCJ does not:

class nothrow
{
  public static void main(String[] argv)
  {
    try
      {
        System.out.println("Hello");
      }
    catch (java.io.IOException e) // never thrown.
      {
        e.printStackTrace();
      }
  }
}

The bytecode emitted by 'gcj -C' on this program is apparently still valid, however.

Exists in versions 3.3.2 and 3.5.0 CVS HEAD.

-- 
           Summary: GCJ does not give an error for checked exceptions that
                    are never thrown
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: csm at gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17157


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug java/17157] GCJ does not give an error for checked exceptions that are never thrown
  2004-08-23 22:11 [Bug java/17157] New: GCJ does not give an error for checked exceptions that are never thrown csm at gnu dot org
@ 2004-08-23 22:15 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-23 22:15 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-23 22:15 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-23 22:15:23
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17157


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-23 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-23 22:11 [Bug java/17157] New: GCJ does not give an error for checked exceptions that are never thrown csm at gnu dot org
2004-08-23 22:15 ` [Bug java/17157] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).