c++/596: SEGV on illegal code when using undeclared functions and members

erik@mail.nu erik@mail.nu
Tue Oct 3 12:06:00 GMT 2000


>Number:         596
>Category:       c++
>Synopsis:       SEGV on illegal code when using undeclared functions and members
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 03 12:06:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Erik Søe Sørensen
>Release:        gcc version 2.96 20000731 (experimental)
>Organization:
>Environment:
Linux 2.2.16-3 i586
>Description:
G++ violates segments, when I from an undeclared member function call an undefined function.
I'm normally not that stoopid - it just occurred when isolating another ICE source! (honest!)
>How-To-Repeat:
Example code is:
-----------
class C {};

void C::a() {
    b();
}
-----------End-of-code
Compiler output is:
----------------------
[ao@jernhamsteren dynmod]$ g++ -v test3.cc
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (experimental)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2 -v -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__ test3.cc /tmp/ccPz55Fz.ii
GNU CPP version 2.96 20000731 (experimental) (cpplib)
 (i386 Linux/ELF)
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus /tmp/ccPz55Fz.ii -quiet -dumpbase test3.cc -version -o /tmp/ccyNPfOY.s
GNU C++ version 2.96 20000731 (experimental) (i386-redhat-linux) compiled by GNU C version 2.96 20000731 (experimental).
test3.cc:3: no `void C::a ()' member function declared in class `C'
test3.cc: In method `void C::a ()':
test3.cc:4: `b' undeclared (first use this function)
test3.cc:4: (Each undeclared identifier is reported only once for each 
function it appears in.)
test3.cc:4: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
---------------End-of-output
(I'm not sure if that '-v' option contributed with anything interresting, but... here you are...)
>Fix:

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


More information about the Gcc-bugs mailing list