From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31597 invoked by alias); 26 Jan 2008 17:28:13 -0000 Received: (qmail 31416 invoked by uid 48); 26 Jan 2008 17:27:30 -0000 Date: Sat, 26 Jan 2008 17:41:00 -0000 Subject: [Bug c/34982] New: [4.3 regression] calling a function with undefined parameters causes segmentation fault at -O1 or higher X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bero at arklinux dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg03239.txt.bz2 The following (admittedly ugly) piece of code works on older gccs, and segfaults on 4.3: #include #include 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