This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/5447: GCC/G++ 3.0.3 will segfault given the following file.
- From: null_and_void at users dot sourceforge dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 21 Jan 2002 22:14:28 -0000
- Subject: c++/5447: GCC/G++ 3.0.3 will segfault given the following file.
- Reply-to: null_and_void at users dot sourceforge dot net
>Number: 5447
>Category: c++
>Synopsis: GCC/G++ 3.0.3 will segfault given the following file.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Jan 21 14:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Paul Varga
>Release: 3.0.3
>Organization:
>Environment:
Linux 2.4.5, i686 (Althon TBird 900 Mhz).
>Description:
Causes G++ to segfault:
seg3.cpp:1: Internal error: Segmentation fault
>How-To-Repeat:
Create a file named 'something.cpp' (it must be a C++ extension, not a C one). Fill the file with this code:
// ---
void someFunc(char *[][], int, int);
int main(void) {
return 0;
}
void someFunc(char *arr[][], int alpha, int beta) {
}
// ---
Simply compile it using (for example): g++ -o abc something.cpp. If you use the gcc frontend to g++ it will segfault also. It will not segfault if it is a .c file.
>Fix:
Use 'char ***' instead of 'char *[][]'. Or use 'char *[][num]' instead of 'char *[][]'.
>Release-Note:
>Audit-Trail:
>Unformatted: