From patchwork Fri Oct 11 11:44:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1996051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ukkWgyR3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQ4YZ5k9Gz1xt1 for ; Fri, 11 Oct 2024 22:45:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87FC9385AC1C for ; Fri, 11 Oct 2024 11:45:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id A87733858C2B for ; Fri, 11 Oct 2024 11:44:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A87733858C2B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A87733858C2B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2604:1380:4641:c500::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647081; cv=none; b=aQBcdt5arlrdKbAs2bDIJ8NV99IuL5hAoITGtO+eB/oCAjWW0Ky4EN2bj+tvMM6QwAhMHxFaJ5X3VUVaG8KMYMPHX0Ftq7RPW1GVB61WBtzw/egtlym60bB0ci4hG+pTOnxg7cZstelOoFhKU4C8yRcHQfJANkvICa4ySDMy+ks= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647081; c=relaxed/simple; bh=BDKSIw86wD+P+rW4CG67M1e+M2UHU+ZkOeHIAjFTePY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=WiLu/2K+lc0mb6dGpIV6MzDs1pLnXH8T/gJQ6jvDylrICa44SjanLLm3V+DATouO94mBEMUSxZ1cuxL3fbzyalG6iveM2NjYrONDMn/88dfDdsunxOmgScXi9LelTDunJQsgognLgu7pkIuuB2C5/cF1/AXNkxCM5ioLlFRri7M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EC89D5C5E8E for ; Fri, 11 Oct 2024 11:44:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54603C4CEC3; Fri, 11 Oct 2024 11:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647079; bh=BDKSIw86wD+P+rW4CG67M1e+M2UHU+ZkOeHIAjFTePY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ukkWgyR3gQqXqysZx1KkLlMqnpy06AvDKFg0meye3QyxwL2gEt93a6yL4O+hNqBag YF/bRwAzgnIP7NqrY38jPFjqtxzhpr5Uhcu7kjQno6fy3H+KxNhfvBcr3YicFIIW0E SBfVs4ygW+SqbVYTLn97HE6uWy6k5v7xiOILzrezvKnbFWlfL7AaJz4yuWfLNKIt9G mOZXuM88Z/uX5ei8RVk1FrWAfIi6rxlKVotEPuWTNQR6tgQcfvZQTGUsNuZu7c5Q0j CcHBkYIo9kBUQzBbGaXGDdox/NIeYqkSdaUUN/pfK/Xi3G8euUyjTFGVQgmOizG4xC OfqHgjhx5c1aA== Date: Fri, 11 Oct 2024 13:44:36 +0200 From: Alejandro Colomar To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar Subject: [PATCH 1/5] gcc/ginclude/stddef.h: Indent nested cpp conditionals Message-ID: <8db5b662bdfcb06278f4eeb7c68f679e8b2bb0eb.1728646712.git.alx@kernel.org> X-Mailer: git-send-email 2.45.2 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This is in preparation for the following commits. Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 349213108ce..f2c4f28673c 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -396,16 +396,16 @@ typedef __WINT_TYPE__ wint_t; /* A null pointer constant. */ #if defined (_STDDEF_H) || defined (__need_NULL) -#undef NULL /* in case has defined it. */ -#ifdef __GNUG__ -#define NULL __null -#else /* G++ */ -#ifndef __cplusplus -#define NULL ((void *)0) -#else /* C++ */ -#define NULL 0 -#endif /* C++ */ -#endif /* G++ */ +# undef NULL /* in case has defined it. */ +# ifdef __GNUG__ +# define NULL __null +# else /* G++ */ +# ifndef __cplusplus +# define NULL ((void *)0) +# else /* C++ */ +# define NULL 0 +# endif /* C++ */ +# endif /* G++ */ #endif /* NULL not defined and or need NULL. */ #undef __need_NULL From patchwork Fri Oct 11 11:44:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1996052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=CG1aZsIo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQ4Yd1bxKz1xt1 for ; Fri, 11 Oct 2024 22:45:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 699AD385AE4E for ; Fri, 11 Oct 2024 11:45:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id 5EFE7385828B for ; Fri, 11 Oct 2024 11:44:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5EFE7385828B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5EFE7385828B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647083; cv=none; b=o8sGnFHYOkgQYw4Rm/+mD76vJsd6zpfniViZ60XSmkAz/4y8eG/8gk39RehMRqahrdwn8cLAFCvYlYTgWY1zzJeKin8abmo76XTGXoOG7x9b5LfNC2tbF0lFtqWR7NcmKQNfCE71AMvywJpu3Fg2O04ejIS89HiABPPx3MUIFEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647083; c=relaxed/simple; bh=Ms/38EZiyc9pGCDaTtoYiu60OIFy+w47KCaIWj+nm+A=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=B8k7zTu0uALXvkxJivdRBRr2bXbddE81N/SvjTVwEbOguJf4QS6s5wV7ziNWn9an0QWqwow4/eOKBnmuOYqVq5nFTUV205z5q06vbqjPBmG+fPOFlnJ26Q5jlvYSTJzl+q72DreDz4FQfbhKWYzeV1mB0wQlp1lSszLZmWTwMI8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AEAC45C5DD0 for ; Fri, 11 Oct 2024 11:44:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16FBBC4CEC3; Fri, 11 Oct 2024 11:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647081; bh=Ms/38EZiyc9pGCDaTtoYiu60OIFy+w47KCaIWj+nm+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CG1aZsIomGEAJlJIJ7+tq5x5c+6QtByA9rg08ySVLZnFQ8gx5tN4GxvHQWg2Cd/K5 V0WYAoXLg+BY13UCZZ5E20UsHlJ7zpzcj+ImAFdceHCBM82G852S3XjQI0Hb+L4769 W2OfJGc/0uT5x3aFYtV6TGIg6/rkc9URCPqRurbklG2Y+P/3yBe3FFgQcDSBGvJh6N eo1I3JUwSZmc3/yeGgt4ioI0VvEEG/q3MmacCkXbB4VbggzrGQwqRyoOutCIiKzhb4 ocjfsunUZKA5nwYX9Dlq8OYZJzWK6ht7tgbz6LQ1YIKKKkg/Zyng5z5JIZ3YkaUdkv tyncMG0AwNGSQ== Date: Fri, 11 Oct 2024 13:44:39 +0200 From: Alejandro Colomar To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar Subject: [PATCH 2/5] gcc/ginclude/stddef.h: Invert conditional Message-ID: <74c07a6be6e091903c9d88813729263aed1202c4.1728646712.git.alx@kernel.org> X-Mailer: git-send-email 2.45.2 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This is in preparation for the following commit. Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index f2c4f28673c..4d04b0163d5 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -400,10 +400,10 @@ typedef __WINT_TYPE__ wint_t; # ifdef __GNUG__ # define NULL __null # else /* G++ */ -# ifndef __cplusplus -# define NULL ((void *)0) -# else /* C++ */ +# if defined(__cplusplus) # define NULL 0 +# else /* C++ */ +# define NULL ((void *)0) # endif /* C++ */ # endif /* G++ */ #endif /* NULL not defined and or need NULL. */ From patchwork Fri Oct 11 11:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1996054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=FTwMSjzy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQ4b86wLYz1xsc for ; Fri, 11 Oct 2024 22:46:28 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27891385843D for ; Fri, 11 Oct 2024 11:46:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id 2C49D385734D for ; Fri, 11 Oct 2024 11:44:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C49D385734D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2C49D385734D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647087; cv=none; b=dPffp4WRnQxlvZcFSObEDmgvTn1Xgz3H+wh5iOWBfbkhFSUXXJq87SznxZKA9B/Xxo2UWeI51H8ST3gyPkZNXLOJHKQLjCpq/58VUPM7oxVtUK2T5KRJNUCpCCAd2cXNeJUNWyq1+XOv1byceXAyl6ValL5XIoOBVk1U9cVlcJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647087; c=relaxed/simple; bh=QPfQ1s+V8q5g/vKczP8kqmN5TSt41C4zsi+2SUf0DxM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=UtNtSJnxKyojLqBZrUlvtlYY3EVzbTIwm0KQtmOchlDYaFUB9rHpWNHOzkJfF/kQ4/AUbHhK3IvtAe6Zgt+M0VzPgBFSdxjLBHzrDvrxE8GulON+rJGBIkKYIjagS/axq+P9eiwsNRhu7AUfce+KHTcvZOrAlOInKhMgsPLuqss= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7BB2A5C5DD0 for ; Fri, 11 Oct 2024 11:44:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC119C4CEC3; Fri, 11 Oct 2024 11:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647084; bh=QPfQ1s+V8q5g/vKczP8kqmN5TSt41C4zsi+2SUf0DxM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FTwMSjzybo59X8MZqGRo52SKYytwW+yLIPTgrd+KNRH14n20918H0RX5j8TeXoClq NLITqc2r/ftWbAFz0qlTVaoYXGhxgfnN7sOfCxesnxSh1KSOrEGwjCo/2RhNIJ/Llb kHPI9VFnqIktXTALEudGgVRZPKhSe3r7btymIn4WqJSvRvymIRSuZOwB5qS/zzMmik UpQK3rvZuGcMKUJy1K+/wvbn2lU5VCFPvGUu5cEG+76Uiv1/GkhIPPsYq6na9YoEhf eDoIr/laegVouWsZSr0wxow0PrlQFLdT7MMynkNxq78Yi2Q8+jbU2vCHRHlOEp+f9m /xvWe9HU1NICg== Date: Fri, 11 Oct 2024 13:44:42 +0200 From: Alejandro Colomar To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar Subject: [PATCH 3/5] gcc/ginclude/stddef.h: Define NULL as nullptr if possible Message-ID: X-Mailer: git-send-email 2.45.2 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org 0 is a terrible definition of NULL. If possible, that is, for C++11 or later, define is as nullptr. Link: Signed-off-by: Alejandro Colomar --- gcc/ginclude/stddef.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 4d04b0163d5..3d9e9ae53b5 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -401,7 +401,11 @@ typedef __WINT_TYPE__ wint_t; # define NULL __null # else /* G++ */ # if defined(__cplusplus) -# define NULL 0 +# if (__cplusplus >= 201103L) +# define NULL nullptr +# else +# define NULL 0 +# endif # else /* C++ */ # define NULL ((void *)0) # endif /* C++ */ From patchwork Fri Oct 11 11:44:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1996053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Qn75xGE/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQ4Yp3SdDz1xsc for ; Fri, 11 Oct 2024 22:45:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE65E385AE51 for ; Fri, 11 Oct 2024 11:45:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id E1358385AC2A for ; Fri, 11 Oct 2024 11:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1358385AC2A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E1358385AC2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2604:1380:4641:c500::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647089; cv=none; b=t2QoG5cIgjETFNb4K+GMPUifWhEvKtagEsNFcgx8LMMxNAu6iiItMXwztHGhYamieJg5EgKP2/vkMNmn9BeUa+zHIdqc3ODgWy1E8Ylp0oQmzIo8uWUFvSfoiuc2htGT2sucBoep8YaskDGREFXetyOBicNyyEC7PACT7STGX8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647089; c=relaxed/simple; bh=SE6seVzBDWpP7b3GsOhpmskI9wp4lRK4D8zsYw4+ucw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JY87Qu4kFEmz5GiYiElGVwc8Le+z/W2JdgvI2lLbY/E9lstSmUl/0g1gJxGBPJPiXLkg+veCn/eWpYGttJshspXCMh2inQaMGXmvaHvWmRpfF9EX2ChTeKiZh3TouHrVpFuBeepL7eYsEhRqRnjpjZe8Uc986jZK0T1ly5yIqHs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3E75B5C5E8E for ; Fri, 11 Oct 2024 11:44:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A32ADC4CEC3; Fri, 11 Oct 2024 11:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647087; bh=SE6seVzBDWpP7b3GsOhpmskI9wp4lRK4D8zsYw4+ucw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qn75xGE/PTO2rxoOiE5DidbdBv15UsLymvSlXgRLSSZq/6XveFpNZaahZL/sCw0Tp EsWuqUx3Fw65XPPl18gbjB/lhTwBbgA0kY1W5jZ3BwKc2YNdObRbDr2Z0LYW0Oa3hE MCydOsxoAJR7rlEya2DQO5FssQ/ermVmmbWqsFtkjePDL1JMT4ZxJjIVbnteP2ep3U 3M/qLbNZeRwF+ISPuvBqCudlwnGSDB+x5Qyfalct/OyUak4pcN+xS0iZWVf1dIFItH Zn1bhk4YBd+SZfPq2Xboqiubok8/mAZH6MvxzEEU30gRq7pbon2zbG70/0RwQxEe/G YP+HzcG9Wso2Q== Date: Fri, 11 Oct 2024 13:44:45 +0200 From: Alejandro Colomar To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar Subject: [PATCH 4/5] Don't define NULL as 0 in C Message-ID: <30dc1a7973f46f073528207e0772d1212bf407db.1728646712.git.alx@kernel.org> X-Mailer: git-send-email 2.45.2 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org That was insane. Link: Signed-off-by: Alejandro Colomar --- gcc/testsuite/gcc.c-torture/execute/pr68143_1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/pr70566.c | 2 +- gcc/testsuite/gcc.dg/tm/20100615.c | 2 +- gcc/testsuite/gcc.target/aarch64/pr91927.c | 2 +- libiberty/alloca.c | 2 +- libiberty/argv.c | 2 +- libiberty/getopt1.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68143_1.c b/gcc/testsuite/gcc.c-torture/execute/pr68143_1.c index cbfbbc2458b..87978906e6d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr68143_1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr68143_1.c @@ -1,4 +1,4 @@ -#define NULL 0 +#define NULL ((void *) 0) struct stuff { diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70566.c b/gcc/testsuite/gcc.c-torture/execute/pr70566.c index f47106e70c7..4a52d0789f2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr70566.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr70566.c @@ -1,6 +1,6 @@ /* PR target/70566. */ -#define NULL 0 +#define NULL ((void *) 0) struct mystruct { diff --git a/gcc/testsuite/gcc.dg/tm/20100615.c b/gcc/testsuite/gcc.dg/tm/20100615.c index 26964d43367..7b5ab0d827d 100644 --- a/gcc/testsuite/gcc.dg/tm/20100615.c +++ b/gcc/testsuite/gcc.dg/tm/20100615.c @@ -6,7 +6,7 @@ /* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */ /* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */ -#define NULL 0 +#define NULL ((void *) 0) extern void *malloc (__SIZE_TYPE__); __attribute__((transaction_pure)) diff --git a/gcc/testsuite/gcc.target/aarch64/pr91927.c b/gcc/testsuite/gcc.target/aarch64/pr91927.c index f5cde1a5336..e0c0574c949 100644 --- a/gcc/testsuite/gcc.target/aarch64/pr91927.c +++ b/gcc/testsuite/gcc.target/aarch64/pr91927.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mstrict-align -O3" } */ -#define NULL 0 +#define NULL ((void *) 0) typedef unsigned uint32_t; typedef struct __attribute__((__packed__)) diff --git a/libiberty/alloca.c b/libiberty/alloca.c index b75f7560f94..3bf0b17b41c 100644 --- a/libiberty/alloca.c +++ b/libiberty/alloca.c @@ -78,7 +78,7 @@ static long i00afunc (); #endif #ifndef NULL -#define NULL 0 +#define NULL ((void *) 0) #endif /* Define STACK_DIRECTION if you know the direction of stack diff --git a/libiberty/argv.c b/libiberty/argv.c index f889432a868..3cb79a09eca 100644 --- a/libiberty/argv.c +++ b/libiberty/argv.c @@ -44,7 +44,7 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef NULL -#define NULL 0 +#define NULL ((void *) 0) #endif #ifndef EOS diff --git a/libiberty/getopt1.c b/libiberty/getopt1.c index 7db3d167757..cb80c5ed3d8 100644 --- a/libiberty/getopt1.c +++ b/libiberty/getopt1.c @@ -61,7 +61,7 @@ #endif #ifndef NULL -#define NULL 0 +#define NULL ((void *) 0) #endif int From patchwork Fri Oct 11 11:44:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1996055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=N69fyduA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQ4cC0Ttdz1xsc for ; Fri, 11 Oct 2024 22:47:23 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47F1F385772C for ; Fri, 11 Oct 2024 11:47:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id AD473385AC36 for ; Fri, 11 Oct 2024 11:44:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD473385AC36 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD473385AC36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2604:1380:4641:c500::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647092; cv=none; b=oE2TMzABrKF2FXVDRIgFDEq5CHh/McO8x45FKCo8eks8qAjAaqhdd5YCchQ/hXiGQcwuSTIkA/oZP2StmuttxEypXOG8H0Io1XY2PUNlSqjRB/1QgN2j4wpCFfeKMJ2je8VTGrlItgG9WRZpolgsHsMGqDSvedkx4tYGnNI11g8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728647092; c=relaxed/simple; bh=0fzy0rnb4uq3gB8qWknY9hoy+uB9tO/6GbMWqSG/Ibg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=RhTiGURtTmBkTEHuNht9DLhHbokt4kMe0+P+5zrAgwabBMnde36Ry1dH2XhatcNVctBhfKecvE9CD+tF6MS6gR5lHSj2ZcJeSflYnQFRqqAi9u8Sw9dnMGEAcvKkpXGzsi+e8WAyo3KQsWuKMPt4XJMOgMZtURd5CMZgSfoTe7U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 026EC5C5E8C for ; Fri, 11 Oct 2024 11:44:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FB72C4CEC3; Fri, 11 Oct 2024 11:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647090; bh=0fzy0rnb4uq3gB8qWknY9hoy+uB9tO/6GbMWqSG/Ibg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N69fyduAL41T2DjRaO5K4SdPQbQHuHPwBugAk39VckSC6B4nEj4h7UFYURyGedby3 OtjgbYZTPfeVhP2gbxv6Ty3kJjXg7MWsp8PAzbK8lCB7vpk0TpH0qwPlqrD2pbE1dJ FJCwr0dLHRdMpr4Q6IPzASlQE9L4zdFyuqGuiJ9ujb5yADOrK0gkjmIhbCf1DJ4vJc puoNNOL1zvhgHU1BEDi/jxweXA0mdbOpw2FqjfG7SYcAwUpKQraoiSpaH8zAJghgqU 3G0nyduZAEBquz79NQPZ+7RmBivpa/1xs9Runug3ku3SB8ZMxfqIeJ4VuqQx8dYzEc f96aNFXGE9uEg== Date: Fri, 11 Oct 2024 13:44:47 +0200 From: Alejandro Colomar To: gcc-patches@gcc.gnu.org Cc: Alejandro Colomar Subject: [PATCH 5/5] libgm2/libm2pim/wrapc.cc: Define NULL as nullptr Message-ID: X-Mailer: git-send-email 2.45.2 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org For internal C++ code, unconditionally define NULL as nullptr. We already require a C++11 compiler to bootstrap GCC anyway. Link: Signed-off-by: Alejandro Colomar --- libgm2/libm2pim/wrapc.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libgm2/libm2pim/wrapc.cc b/libgm2/libm2pim/wrapc.cc index 5c31f1e2687..cdd1cf0d0fe 100644 --- a/libgm2/libm2pim/wrapc.cc +++ b/libgm2/libm2pim/wrapc.cc @@ -63,10 +63,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include #endif -/* Define a generic NULL if one hasn't already been defined. */ - #if !defined(NULL) -#define NULL 0 +#define NULL nullptr #endif /* strtime returns the address of a string which describes the