From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127105 invoked by alias); 12 Feb 2018 19:30:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 126288 invoked by uid 89); 12 Feb 2018 19:30:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f42.google.com Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Feb 2018 19:30:02 +0000 Received: by mail-wm0-f42.google.com with SMTP id g1so11633746wmg.2 for ; Mon, 12 Feb 2018 11:30:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=oGEgCrKxTIHWWb9+7vkaK9ao8STtxLq8lA7PA5er9ck=; b=TfgYkpWFCBbT5YXYvp54aJ6QE2fO7WD8iNDXZdFSjjk+ocdqmqwOqCpIOIQG+9hgIe uQNWUOJmJNVRz2e5CPLs9Froj5I2Va4wG0mdtObeKOLlfKmwW6k/nX8mlAvAcj5sOZOJ GpZokEBMZkwTpXdExOWPue0Vyw5+vHzGernSrNU0T3whDicly2xn3ncUiVqj9ZtS43aN HAeHddEWHFQz/eTrqxS2fQ0MyCVNznKWv1h5YiBaaoUoUo1eKFCx9FONnabyTw67jzO1 QaztgtWtLFzwr5YVJxkKSGTd+1PDva2rf7zj+1k/bW+SMekpo1g3Zr6WuW02DibMoVV4 QU4Q== X-Gm-Message-State: APf1xPCT3LCPuIn4DkgjTPcaUHnTADeGuFO1sFfZ+Lfh8rXp0cyAAAR1 MgmrvWCRmNI4d8pXguiULAmf9ZZ40XeakhtPX9Hlf0Sa X-Google-Smtp-Source: AH8x225fZEi3iDY76hbw63XlUeuTl496ohq3skbcK4Dj30weQ8sS/gkEUqa9JPJ7WYq2kS9sPTQgXwFk+iJC2tEmKTU= X-Received: by 10.80.174.219 with SMTP id f27mr7741443edd.28.1518463799880; Mon, 12 Feb 2018 11:29:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.148.168 with HTTP; Mon, 12 Feb 2018 11:29:59 -0800 (PST) From: Ian Lance Taylor Date: Mon, 12 Feb 2018 19:30:00 -0000 Message-ID: Subject: Go patch committed: error on func declaration/definition To: gcc-patches , gofrontend-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-02/txt/msg00666.txt.bz2 Long long long ago Go permitted writing func F() in one file and writing func F() {} in another file. This was removed from the language, and that is now considered to be a multiple definition error. Gccgo never caught up to that, and it has been permitting this invalid code for some time. Stop permitting it, so that we give correct errors. Since we've supported it for a long time, the compiler uses it in a couple of cases: it predeclares the hash/equal methods if it decides to create them while compiling another function, and it predeclares main.main as a mechanism for getting the right warning if a program uses the wrong signature for main. For simplicity, keep those existing uses. This required a few minor changes in libgo which were relying, unnecessarily, on the current behavior. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian