From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14176 invoked by alias); 6 Apr 2002 01:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14155 invoked by uid 71); 6 Apr 2002 01:36:01 -0000 Resent-Date: 6 Apr 2002 01:36:01 -0000 Resent-Message-ID: <20020406013601.14154.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, safari@iki.fi Received:(qmail 13555 invoked by uid 61); 6 Apr 2002 01:33:44 -0000 Message-Id:<20020406013344.13554.qmail@sources.redhat.com> Date: Fri, 05 Apr 2002 17:36:00 -0000 From: safari@iki.fi Reply-To: safari@iki.fi To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/6198: reaching end of main() should cause return with 0 X-SW-Source: 2002-04/txt/msg00397.txt.bz2 List-Id: >Number: 6198 >Category: c >Synopsis: reaching end of main() should cause return with 0 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Apr 05 17:36:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: safari@iki.fi >Release: 3.0.4 >Organization: >Environment: Linux 2.4.19-pre3-aa2 i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /mnt/tmpfs/1/gcc-3.0.4/configure >Description: http://www.opengroup.org/onlinepubs/007904975/functions/exit.html says: "Reaching the end of the main() function has the same behavior as calling exit(0)." however, gcc does not set %eax register to 0 before `ret', causing (on my system) this program to return with 1: int main(void) { } >How-To-Repeat: >Fix: trivial ;-D >Release-Note: >Audit-Trail: >Unformatted: