This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34982] New: [4.3 regression] calling a function with undefined parameters causes segmentation fault at -O1 or higher
- From: "bero at arklinux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2008 17:27:30 -0000
- Subject: [Bug c/34982] New: [4.3 regression] calling a function with undefined parameters causes segmentation fault at -O1 or higher
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following (admittedly ugly) piece of code works on older gccs, and
segfaults on 4.3:
#include <assert.h>
#include <string.h>
static void something();
int main(int argc, char **argv) {
something("test");
}
static void something(const char *whatever) {
assert(!strcmp(whatever, "test"));
}
Changing the initial declaration of something() to static void something(char
*whatever) makes the problem go away.
--
Summary: [4.3 regression] calling a function with undefined
parameters causes segmentation fault at -O1 or higher
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bero at arklinux dot org
GCC build triplet: i586-pc-linux-gnu
GCC host triplet: i586-pc-linux-gnu
GCC target triplet: i586-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34982