public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5447: GCC/G++ 3.0.3 will segfault given the following file.
@ 2002-01-21 14:16 null_and_void
  0 siblings, 0 replies; 3+ messages in thread
From: null_and_void @ 2002-01-21 14:16 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/5447: GCC/G++ 3.0.3 will segfault given the following file.
@ 2003-01-01 20:41 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-01-01 20:41 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, null_and_void

Synopsis: GCC/G++ 3.0.3 will segfault given the following file.

State-Changed-From-To: analyzed->closed
State-Changed-By: paolo
State-Changed-When: Wed Jan  1 12:41:58 2003
State-Changed-Why:
    Cannot be reproduced with 3.2.1, 3.3 pre, mainline.
    Mainline, f.i., issues:
    5447.cc:1: error: multidimensional array must have bounds for all dimensions
       except the first
    5447.cc:7: error: declaration of `arr' as multidimensional array must have
       bounds for all dimensions except the first

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5447


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/5447: GCC/G++ 3.0.3 will segfault given the following file.
@ 2002-01-21 16:25 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-01-21 16:25 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, null_and_void

Synopsis: GCC/G++ 3.0.3 will segfault given the following file.

State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Mon Jan 21 16:25:00 2002
State-Changed-Why:
    segfault reproduced with gcc 3.0.3.
    
    With gcc 3.1 in CVS, no segfault, but the following compilation error, when compiled with g++:
    seg3.cpp:2: multidimensional array must have bounds for all dimensions except
       the first
    seg3.cpp:8: declaration of `arr' as multidimensional array must have bounds for
       all dimensions except the first
    
    Putting it in a seg3.c file and compiling with gcc -pedantic
    yields warnings:
    seg3.c:2: warning: array type has incomplete element type
    seg3.c:8: warning: array type has incomplete element type

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5447


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-01 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-21 14:16 c++/5447: GCC/G++ 3.0.3 will segfault given the following file null_and_void
2002-01-21 16:25 rodrigc
2003-01-01 20:41 paolo

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