public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1335: illegal type "long" accepted for "switch" expression
@ 2000-12-20 12:25 bryce
  0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:25 UTC (permalink / raw)
  To: java-gnats

>Number:         1335
>Category:       java
>Synopsis:       illegal type "long" accepted for "switch" expression
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tromey
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:08 PST 2000
>Closed-Date:    Fri Dec 15 19:44:55 PST 2000
>Last-Modified:  Fri Dec 15 19:50:02 PST 2000
>Originator:     Bryce McKinlay
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
"int", "short", "char" and "byte" are the only legal types
for a switch statement expression. But gcj also accepts "long".
The following code is illegal.

class LongSwitch
{
  void m(long l)
  {
    switch (l) {}
  }
}
>How-To-Repeat:
Just try to build libgcj.zip with something that isn't 
"gcj -C" ;-)
>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/310

Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Wed Aug  9 18:06:43 2000
Responsible-Changed-Why:
    I submitted a patch.

From: tromey@cygnus.com
To: apbianco@cygnus.com, bryce@albatross.co.nz,
  java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/310
Date: 10 Aug 2000 01:06:43 -0000

 Synopsis: illegal type "long" accepted for "switch" expression
 
 Responsible-Changed-From-To: apbianco->tromey
 Responsible-Changed-By: tromey
 Responsible-Changed-When: Wed Aug  9 18:06:43 2000
 Responsible-Changed-Why:
     I submitted a patch.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=310&database=java

From: tromey@sourceware.cygnus.com
To: java-gnats@sources.redhat.com
Cc:  
Subject: gcj/310
Date: 10 Aug 2000 01:09:12 -0000

 CVSROOT:	/cvs/java
 Module name:	libgcj
 Changes by:	tromey@sourceware.cygnus.com	2000-08-09 18:09:12
 
 Modified files:
 	libjava/testsuite: ChangeLog 
 Added files:
 	libjava/testsuite/libjava.compile: PR310.java PR310.xfail 
 
 Log message:
 	From PR gcj/310:
 	* libjava.compile/PR310.java: New file.
 	* libjava.compile/PR310.xfail: New file.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/ChangeLog.diff?cvsroot=java&r1=1.105&r2=1.106
 http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/libjava.compile/PR310.java.diff?cvsroot=java&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/libjava.compile/PR310.xfail.diff?cvsroot=java&r1=NONE&r2=1.1
 

From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/310
Date: Wed, 9 Aug 2000 19:33:29 -0700 (PDT)

 tromey@cygnus.com writes:
 >  Responsible-Changed-Why:
 >      I submitted a patch.
 
 I can't see the patch. Can you check with GNAT?
 
 ./A

From: Tom Tromey <tromey@cygnus.com>
To: Alexandre Petit-Bianco <apbianco@cygnus.com>
Cc: Java Gnats Server <java-gnats@sourceware.cygnus.com>
Subject: gcj/310
Date: 19 Aug 2000 18:15:03 -0600

 Alex, here's a reference to my patch for PR 310:
 
     http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00428.html
 
 Tom

From: Tom Tromey <tromey@cygnus.com>
To: apbianco@redhat.com
Cc: Java Gnats Server <java-gnats@sourceware.cygnus.com>
Subject: Re: gcj/310
Date: 19 Aug 2000 19:47:55 -0600

 Alex>   `boolean_type_node' is already covered by JINTEGRAL_TYPE_P used right
 Alex>   above your patch -- have you witnessed some improper behaviors with
 Alex>   booleans?
 
 Thanks.  How about this revised patch, which is much simpler?
 
 2000-08-09  Tom Tromey  <tromey@cygnus.com>
 
 	* parse.y (patch_switch_statement): Disallow `long' in switch
 	expressions.  Fixes PR gcj/310.
 
 Tom
 
 Index: parse.y
 ===================================================================
 RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
 retrieving revision 1.200
 diff -u -r1.200 parse.y
 --- parse.y	2000/08/11 22:01:37	1.200
 +++ parse.y	2000/08/20 01:38:52
 @@ -14413,7 +14429,7 @@
    se_type = TREE_TYPE (se);
    /* The type of the switch expression must be char, byte, short or
       int */
 -  if (!JINTEGRAL_TYPE_P (se_type))
 +  if (! JINTEGRAL_TYPE_P (se_type) || se_type == long_type_node)
      {
        EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node);
        parse_error_context (wfl_operator,

From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: Java Gnats Server <java-gnats@sourceware.cygnus.com>
Cc:  
Subject: Re: gcj/310
Date: Sat, 19 Aug 2000 22:31:27 -0700 (PDT)

 Tom Tromey writes:
 
 > Thanks.  How about this revised patch, which is much simpler?
 
 Cool. Go ahead, check it in. Thank you.
 
 ./A
State-Changed-From-To: open->feedback
State-Changed-By: tromey
State-Changed-When: Sun Aug 20 09:30:18 2000
State-Changed-Why:
    I checked in a fix for this.
    Can you try it out & get back to me?

From: tromey@cygnus.com
To: bryce@albatross.co.nz, java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/310
Date: 20 Aug 2000 16:30:18 -0000

 Synopsis: illegal type "long" accepted for "switch" expression
 
 State-Changed-From-To: open->feedback
 State-Changed-By: tromey
 State-Changed-When: Sun Aug 20 09:30:18 2000
 State-Changed-Why:
     I checked in a fix for this.
     Can you try it out & get back to me?
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=310&database=java
State-Changed-From-To: feedback->closed
State-Changed-By: bryce
State-Changed-When: Fri Dec 15 19:44:55 2000
State-Changed-Why:
    The fix works fine.

From: bryce@albatross.co.nz
To: bryce@albatross.co.nz, java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: gcj/310
Date: 16 Dec 2000 03:44:55 -0000

 Synopsis: illegal type "long" accepted for "switch" expression
 
 State-Changed-From-To: feedback->closed
 State-Changed-By: bryce
 State-Changed-When: Fri Dec 15 19:44:55 2000
 State-Changed-Why:
     The fix works fine.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=310&database=java
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:25 java/1335: illegal type "long" accepted for "switch" expression bryce

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).