From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35387 invoked by alias); 8 May 2018 11:39:11 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 35357 invoked by uid 89); 8 May 2018 11:39:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*aph, H*f:sk:1eda668, Hx-languages-length:998, H*i:sk:1eda668 X-HELO: mail-it0-f53.google.com Received: from mail-it0-f53.google.com (HELO mail-it0-f53.google.com) (209.85.214.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 May 2018 11:39:07 +0000 Received: by mail-it0-f53.google.com with SMTP id 70-v6so15934964ity.2 for ; Tue, 08 May 2018 04:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Ec689W1H4FIGmbJSQou2hefu/+rrhsi5SsdBFODho2M=; b=t4gH2dIg7sm7EHJQXQX65Jo3ojJj7BKZEnTytIAHaH05hCwIjGTHkT7ymNdvd2YURa zQnuBDB4qaC5yoMq3NEoaLKeH2uXj0V24Fcg5E96F+B4M/11Ubf5keyc/Ku4Z8ImdQ/n RWLoVSSlB2tHKRRyH9uv0g/kXIhcuGDnmVRDR+dWIPmK9Din4VxwCRlM22EAHYbdVl3Q JaItXGQ7DcyxacBA/ukt+E21kdtXnfJf7/upHynGveX9tZNXlLZdzjlwPnTNU/XndViN aNXreoo6Q9FURfttYGLIcTU3vq/dTu5s8LwKGC6JATDjxuvUaX8WUZJ9qMevwPoN9fEV MEtg== X-Gm-Message-State: ALKqPwdZwE3fLfcDSCgbL2d27LQC9Jft0QIihXNiY8/YZjYV/F+EARgM XdkpIylzxZoj095YhjE07RzGgBABHo7xgQeXL3M= X-Google-Smtp-Source: AB8JxZqmQZDB3Lf8EENHI2OJN1ijh4E0CUPeVEtFoZmtpgRzxKabG5xw7jPkE1biNdfUChO2hiR7CaO07Ae7zTN52qY= X-Received: by 2002:a24:6515:: with SMTP id u21-v6mr5538761itb.80.1525779546323; Tue, 08 May 2018 04:39:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.17.216 with HTTP; Tue, 8 May 2018 04:39:05 -0700 (PDT) In-Reply-To: <1eda6680-f574-7637-42dd-4309dacb012e@redhat.com> References: <20180425122305.GS20930@redhat.com> <7039f928-e50b-1f75-4f71-70fda5873ab0@redhat.com> <20180425144008.GU20930@redhat.com> <1eda6680-f574-7637-42dd-4309dacb012e@redhat.com> From: Jonathan Wakely Date: Tue, 08 May 2018 11:39:00 -0000 Message-ID: Subject: Re: [RFC] Deprecate "implicit int" for main() in C++ To: Florian Weimer Cc: Jonathan Wakely , Andrew Haley , "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00055.txt.bz2 On 8 May 2018 at 12:35, Florian Weimer wrote: > On 04/25/2018 04:40 PM, Jonathan Wakely wrote: >> >> More concretely, deprecating it for a few releases would allow us to >> apply the attached patch at some point in the future, so that instead >> of: >> >> rt.c:1:6: warning: ISO C++ forbids declaration of =E2=80=98main=E2=80=99= with no type >> [-Wreturn-type] >> main() { return 0; } >> ^ >> >> We'd get: >> >> rt.c:1:6: error: ISO C++ forbids declaration of 'main' with no type >> [-fpermissive] >> main() { return 0; } >> ^ > > > I wonder if it's currently a warning because the implicit int is used in > configure checks. If this is the case, maybe we cannot make it an error > without altering the result of configure tests? Sigh, you're probably right. Since GCC 8.1 any such configure tests will get a warning (or an error with -Werror) so maybe they'll eventually get fixed. Jason already expressed a preference for not making the change anyway.