From patchwork Tue Jan 23 13:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 190965 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp346728dyi; Tue, 23 Jan 2024 05:55:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGI2+e3xDrghQjzkjz+k8w8/GTA0vMUQAt5Uf4NdqJE04X2cjPbKXRQ+PXzXNaGCJmaH7hk X-Received: by 2002:a05:6214:529c:b0:681:553c:295b with SMTP id kj28-20020a056214529c00b00681553c295bmr872452qvb.112.1706018155324; Tue, 23 Jan 2024 05:55:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706018155; cv=pass; d=google.com; s=arc-20160816; b=zx3ZK9LSQ3GhYqnOSnBWurtKYKdbCU1iedfoR57UMZfL+L+wkarGeiXcn1ZCVPsfoP PgH/DaPtBU3PBCoCHxVAJvaWxIm0FvayEjqjmwlx6EMeniUMvNCqSihtBcvWaf8k5ulw NfJIIk+p/HbAYrjWxj5rIvPAvXFsnuAwHFoUk2cppQUFZ+ozUdo47Wf08j5rQV7dCXqy bVZ1J11fo2uCkr9MIHKOEug8u1G64/u4PX6a9jg1TcvKvEvkOvhbMnS13ifGtzUN0yJP iYcE6b6wIy2FCso23rykIdyv26dMJdg2WdTOf0eiyQQKRAVLGBjhhEHT2RAH6U7L2lmC NAOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=KM7kTiYPvcnDadSXXfsxV7112NsBr11Sq1dUkIilzJ8=; fh=RU3aQ9qmXHWqDHqpxXTKO/UkvTgUT8ft2LAgMQexrNI=; b=pzgZEsF6TFSa80cMVJICyYhteZcwKFUCukHYxV/q5JXb1NjUf7M4YQrH0iuva00oYX +815m64f/0ugQAdWN+/dopC7wFR7pLX11CVZ2tqlKMSs5QRPuy/VSI+UOnqR6UNHQrnF XNYpOepf0n7aIeFzJ1IZWiyA5VBBqV6gz5/k1RCVcUQ1N0bUWGgPr0xJCTOE29tnaybU DXvbEnerpzhKnYFXZmUgBoWqG6jENU4rVy9qCJPKFnErt/+Yoz0X69pu82Hjzk8+1OTj IDP5pxJJYpW1hr7xflcy1BGwUuBS4tov91lHirDpE3KIfU6GVHEBsys5mNsE/uM3/r3k qEIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PJxaJZk8; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q19-20020a0cf5d3000000b00681940bdb9csi8053536qvm.278.2024.01.23.05.55.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:55:55 -0800 (PST) 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=@gmail.com header.s=20230601 header.b=PJxaJZk8; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A3D5385840C for ; Tue, 23 Jan 2024 13:55:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 248B43858C50; Tue, 23 Jan 2024 13:55:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 248B43858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 248B43858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706018111; cv=none; b=WmXsswPY5xerJm2QcYDGBv5h72bCmYgOIBfQuyuXoqtS+/qGb8t6cJWOUA/ZSNYUuZk8dQgJIykkRwIhgPhZDOCbf9cTWl1mkP+SpcB0/hfMWsZJgcReyPr1kedeG6fEh1v9hR6YFUPNz0m/8M3tPeGQLknbdcdfwWy2HqZrfSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706018111; c=relaxed/simple; bh=D9eO61zhxQWWfmlRhlbbwkoCxWNCu9N9znKAjKMuMU4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gc2eDvgtfBEhkb7U+ZTQ+6rSFUjoDNAd6rvZZ51kCHWUc00b7sYD7EgXbryFAchZPYWEw9n/sBjH92Rw1+vGHoCTLZuoGwd/PiZhFCkxiiVVUVV8UUqgodl1oYFOf1DZCkfhlsSl5n0d4+HZUvi5OdJkVKOsRMsodXofO4+eNG8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-28bec6ae0ffso2115049a91.3; Tue, 23 Jan 2024 05:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706018109; x=1706622909; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KM7kTiYPvcnDadSXXfsxV7112NsBr11Sq1dUkIilzJ8=; b=PJxaJZk8Y0J4Wh3Fnu5jlniCLWkcqi2C9A3feQPCcLRDzgWl4JnsffFyyac0o9zLMa 2BiQ2aoJ5vL8rDEEVpEmG5rF4KH7xVaywHUjQ/o65Btq0YkqxnslaN2GRgd0xXLajg52 BiU1tnYWSKp2PPJbiB+xwz4yW7Temc373UEzdU7aE66f3ZD5yriVt+B3J7WIkt8Uyl+D Q1RsmmjlbM/LpoMhc/Q1eGGFDiIcBtdaePlu7WhUBN7aIQBA/PnWkodicUrNghQnrk15 Q34fkX7rws5QDKLX9C0unwBqQZNV6jteN908eXHm/YGfT5TjQIGer5PQyOEnRWT4hkvT PydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706018109; x=1706622909; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KM7kTiYPvcnDadSXXfsxV7112NsBr11Sq1dUkIilzJ8=; b=SMR1wl0CxXPdnZkATSKKBundhU6pXb8GCyto2y9GfV+aHk6BVVJW7CikK6xVdlqie1 LtzYJpudvYo2o3xTyJI8GTxFiwdKNdwOFHh4cXkHmX86k2LeNQp54ORawMCBJ4bYlO7i 5HIVoC7104BHeYJfPzPdZ7+v48gkfnjsb+uuP4NZlZzxUB7nH1ArdiWokT9h0waNr/EA XQErcnbGqO+G2myrNCzui8XSA2zNx335pCM++5eB9R4tiGo2AFX6Yv94unXt1UqRCjJf 9SvCUqp9QOfWz5rKtmVhgsEZZy0fTNnVXngDkGfBDvpxHFPXv9FWZtPtMsKnf3YDk6B5 CFkQ== X-Gm-Message-State: AOJu0Yz6T51Hc8NYY5exs3xVt9MBP3t7z2H0dep4zutFbipaaV+xmD8x G4z4NZJ863FZu5v7msdfrMa1hq0Vmno5LvjiID7Q8psZb8G0hmxwqeJ9bJ9q X-Received: by 2002:a17:90a:24e:b0:28c:64:b171 with SMTP id t14-20020a17090a024e00b0028c0064b171mr2423053pje.57.1706018108723; Tue, 23 Jan 2024 05:55:08 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.56.168.9]) by smtp.gmail.com with ESMTPSA id qc12-20020a17090b288c00b00290a26531f5sm4338620pjb.7.2024.01.23.05.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:55:08 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 3708A740139; Tue, 23 Jan 2024 05:55:07 -0800 (PST) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: doko@gcc.gnu.org, gaiusmod2@gmail.com Subject: [PATCH] m2: Use time_t in time and don't redefine alloca Date: Tue, 23 Jan 2024 05:55:07 -0800 Message-ID: <20240123135507.158395-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3024.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788889693358907595 X-GMAIL-MSGID: 1788889693358907595 Fix the m2 build warning and error: [...] ../../src/gcc/m2/mc/mc.flex:32:9: warning: "alloca" redefined 32 | #define alloca __builtin_alloca | ^~~~~~ In file included from /usr/include/stdlib.h:587, from :22: /usr/include/alloca.h:35:10: note: this is the location of the previous definition 35 | # define alloca(size) __builtin_alloca (size) | ^~~~~~ ../../src/gcc/m2/mc/mc.flex: In function 'handleDate': ../../src/gcc/m2/mc/mc.flex:333:25: error: passing argument 1 of 'time' from incompatible point er type [-Wincompatible-pointer-types] 333 | time_t clock = time ((long *)0); | ^~~~~~~~~ | | | long int * In file included from ../../src/gcc/m2/mc/mc.flex:28: /usr/include/time.h:76:29: note: expected 'time_t *' {aka 'long long int *'} but argument is of type 'long int *' 76 | extern time_t time (time_t *__timer) __THROW; PR bootstrap/113554 * mc/mc.flex (alloca): Don't redefine. (handleDate): Replace (long *)0 with (time_t *)0 when calling time. --- gcc/m2/mc/mc.flex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/m2/mc/mc.flex b/gcc/m2/mc/mc.flex index bd37d5ad100..7c841bf8d63 100644 --- a/gcc/m2/mc/mc.flex +++ b/gcc/m2/mc/mc.flex @@ -28,9 +28,11 @@ along with GNU Modula-2; see the file COPYING3. If not see #include #include +#ifndef alloca #ifdef __GNUC__ #define alloca __builtin_alloca #endif +#endif #if !defined(TRUE) # define TRUE (1==1) @@ -330,7 +332,7 @@ handleColumn (void) static void handleDate (void) { - time_t clock = time ((long *)0); + time_t clock = time ((time_t *)0); char *sdate = ctime (&clock); char *s = (char *)alloca (strlen (sdate)+2+1); char *p = strchr(sdate, '\n');