This is the mail archive of the gcc-prs@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++/5447: GCC/G++ 3.0.3 will segfault given the following file.



>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:


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