This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6453: g++ regression in 3.1



>Number:         6453
>Category:       c++
>Synopsis:       g++ regression in 3.1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 25 08:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Anthony Green
>Release:        3.1 20020424 (prerelease)
>Organization:
>Environment:
System: Linux louie 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /louie/green/3.1/gcc/configure --prefix=/louie/green/3.1/i --enable-threads --enable-languages=c,c++,java : (reconfigured)  : (reconfigured) 
>Description:
Given the following nonsense code...

void *foo()
{
  char x[100];
  x++;
  return (void *) x;
}

Red Hat's g++ 2.96 reports:

$ g++ -c c.cc
c.cc: In function `void *foo ()':
c.cc:4: non-lvalue in increment
c.cc:3: warning: address of local variable `x' returned

Unfortunately I don't have an older FSF release handy to test on (like
2.95, or 3.0), so I don't know what they do.  However, the current 3.1
branch says:

$ g++ -c c.cc
non-lvalue

in

increment

address

of

local

variable

`
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


>How-To-Repeat:
Compile the following with g++:

void *foo()
{
  char x[100];
  x++;
  return (void *) x;
}

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]