From patchwork Tue Oct 18 14:10:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 4187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1981336wrs; Tue, 18 Oct 2022 07:11:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hf3S+fNZyMhK5iaky+uA4kT/re+Ff1tyFEKjo8gYSJBHmmUBxBi9AN89hfZ6eqd+jHjJD X-Received: by 2002:a17:906:5dac:b0:78d:fa65:a4a9 with SMTP id n12-20020a1709065dac00b0078dfa65a4a9mr2508462ejv.223.1666102293444; Tue, 18 Oct 2022 07:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666102293; cv=none; d=google.com; s=arc-20160816; b=OiRBImwbHm8mKX6wM0nkoRsgBKeRe/UlRm1W+twKQ64BuFeyM8suVFrY8IpqkkDj3G vuh/cJ67apwgF47qinZ+RudUwU7YOZce5Yagl5p9SB6c0YlBzF1oWGwvIgX98qeKjfb+ io3ytjkl4MGpI6I6ax2UI2RnQ821GhHHhUY8yt5DCJQu23ISd4AvJ00BziVu+qMw0QuW GFLrDs8CTkody3brS/o/4OAbVGu4LLcdlfpenbuKwfRtUWJHbuw+6sTJZluwLCKHDbEK OcG2jmPDzlJ2QiUGtBtd3sfI9jl4JlMjO+Pbva5O/m55/lbhpwTvBajfEIKBJKmnNfjF oTuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:message-id:date:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=6NmpjBYuWBtcIciMqQscGuMzkfCirz1jR5joq2i8ALk=; b=JtCCYP2vDlRjF9FNO4cDN4fdI2te13fIod50xT2g/ehBy5EHglrkl0665gvkcperbU YXKkmAkWnPqz7tlyUWupj/uTqJiO59oWuBDaLifE7Gchv2J1OtU+++AF7u5HFDnE3qvn AWXUHiK8ZIlcNvH9wS1H7xwHidZCEVb65vkkNk3J5Smyla4olQRQ9BfplMbwmdQgHN3u e2HMzp7TDbyTP61uergYh/XJWlsiehg+revLYPtpnIQgodXR3yYfN735TMFw2sLL26Z2 /PPmajF+sUilm4o9uios8UYRADhfcHSVF8OOrUF1mGa9h8bTu7e86nKxxh8khOwgbdDX iF/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vEJxcfri; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hc35-20020a17090716a300b0078081036bdasi12855401ejc.501.2022.10.18.07.11.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 07:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vEJxcfri; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 342AD385800F for ; Tue, 18 Oct 2022 14:11:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 342AD385800F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666102292; bh=6NmpjBYuWBtcIciMqQscGuMzkfCirz1jR5joq2i8ALk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vEJxcfri4Z7dPWiCLc4RZ0v1XFLUxVNafRSnABKZQjHAJdY6tAVK0dShSk9gQNe1+ zSX6AYhaz0C9eP2EPNGB/eDZn4ASuFkLAYTsFh5GecoISnKrcVMfN2t/O7CH0+R9P/ 9NyYqAsVU8JGe6Or0iN+C6OcHklffuFgUssZTt14= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F29513858C83 for ; Tue, 18 Oct 2022 14:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F29513858C83 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-314-fHFtgvo7Pym5kh3HPWhq_g-1; Tue, 18 Oct 2022 10:10:45 -0400 X-MC-Unique: fHFtgvo7Pym5kh3HPWhq_g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BD9485A5A6 for ; Tue, 18 Oct 2022 14:10:45 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFFCE492B0A; Tue, 18 Oct 2022 14:10:44 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] libiberty: Fix C89-isms in configure tests Date: Tue, 18 Oct 2022 16:10:43 +0200 Message-ID: <87v8ohi5ng.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Gcc-patches From: Florian Weimer Reply-To: Florian Weimer Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747019468536228413?= X-GMAIL-MSGID: =?utf-8?q?1747034878301940965?= libiberty/ * acinclude.m4 (ac_cv_func_strncmp_works): Add missing int return type and parameter list to the definition of main. Include and for prototypes. (ac_cv_c_stack_direction): Add missing int return type and parameter list to the definitions of main, find_stack_direction. Include for exit prototype. * configure: Regenerate. --- libiberty/acinclude.m4 | 14 +++++++++++--- libiberty/configure | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) base-commit: 1dc4488e091ae75bdd2c00a482db0f1b68229154 diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4 index 6bd127e9826..6bb690597bf 100644 --- a/libiberty/acinclude.m4 +++ b/libiberty/acinclude.m4 @@ -24,6 +24,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, [AC_TRY_RUN([ /* Test by Jim Wilson and Kaveh Ghazi. Check whether strncmp reads past the end of its string parameters. */ +#include +#include #include #ifdef HAVE_FCNTL_H @@ -51,7 +53,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, #define MAP_LEN 0x10000 -main () +int +main (void) { #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) char *p; @@ -157,7 +160,10 @@ if test $ac_cv_os_cray = yes; then fi AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, -[AC_TRY_RUN([find_stack_direction () +[AC_TRY_RUN([#include + +int +find_stack_direction (void) { static char *addr = 0; auto char dummy; @@ -169,7 +175,9 @@ AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, else return (&dummy > addr) ? 1 : -1; } -main () + +int +main (void) { exit (find_stack_direction() < 0); }], diff --git a/libiberty/configure b/libiberty/configure index 0a797255c70..ca83f89da6d 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -6780,7 +6780,10 @@ else else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -find_stack_direction () +#include + +int +find_stack_direction (void) { static char *addr = 0; auto char dummy; @@ -6792,7 +6795,9 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } -main () + +int +main (void) { exit (find_stack_direction() < 0); } @@ -7617,6 +7622,8 @@ else /* Test by Jim Wilson and Kaveh Ghazi. Check whether strncmp reads past the end of its string parameters. */ +#include +#include #include #ifdef HAVE_FCNTL_H @@ -7644,7 +7651,8 @@ else #define MAP_LEN 0x10000 -main () +int +main (void) { #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) char *p;