From patchwork Wed Nov 29 23:46:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonny Grant X-Patchwork-Id: 171654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp45991vqy; Wed, 29 Nov 2023 15:46:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtfuiYoanMyMdN0hX16JQJdp542QixGt7isiVpHAQwqYkv6hYeyyM4rXs5gXDvOKnFEK62 X-Received: by 2002:a05:6358:724c:b0:16d:fb29:d78 with SMTP id i12-20020a056358724c00b0016dfb290d78mr19435806rwa.2.1701301598835; Wed, 29 Nov 2023 15:46:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701301598; cv=pass; d=google.com; s=arc-20160816; b=RerQf+X+iYFhEN70eJuzcw0x6ksd8q64I4PSFFFcBc8j3I3JJKiS+IcaFalsK1YZ8y flsofYIE0MZabnKUqimJXV7hXFONV+sAeMxpQh1RzBPd28qGVSNCynwkUkkInFzt0ewL 5a6fA/NZJ6x7fsmJpDcZtwDmlVH/L3U9C1qx4dGcRDc8bKQNbZHwfpV0Uz2m883O2msc zD/ROOpD59GKlReQDvQSi21t426/0U4nULJcFOYkw2B1/x63XN4AVDnZzX65yQE1TX9v eOb4ybKhm0hwhmYJBr5GxT4yDhJaHJxWEQWLVgJty+N9q/jge3yUupqxvL4iOpfOemiK DH8w== 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 :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=4JOygCm4s0wRrlKPzWeamKoTj08TujAcvws/oXeHAOU=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=R0r63+lz23CP3Wve+pK2nLnZbCu7SJUMQwsKD5MllwnwMaGbadPRG8nzWR6HlVKsNs gsK9bGjXzk1m5anqpTFhO4WgFlT9+FYNSO8n1iCynneuz12lWgGG0w3jvi2pms9Bv2iv a3ZZERA6umkldfL0aGp1RsM2g4L3QIdcfNj9nadhKUYJ8geS64QXHbQ89zYqYf8ZwkZa Hoe6DMb+40PVn7wrtm+34o7ui6/lq6/GSm+vUJq0IhkL34ZsMEdalj1U+tR3HF+hQf4O bdjHnCY5G7vYVYy+eSsu84QVG9up7bMLyPzcpjMP2YO4Cp9VK9S+5SK6jo2rje0lSZhX JcxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@jguk.org header.s=google header.b=cgCZHdBq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fv23-20020a05622a4a1700b00423dc6aade1si4531369qtb.584.2023.11.29.15.46.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 15:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@jguk.org header.s=google header.b=cgCZHdBq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 928F2385DC04 for ; Wed, 29 Nov 2023 23:46:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 25E243858C5F for ; Wed, 29 Nov 2023 23:46:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25E243858C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jguk.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jguk.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 25E243858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701301572; cv=none; b=Of3R3SgWjZ+QKUt47xsA4ZnpTK+IYuPvDUvGd+mbm2PfEdrCT0/7pFQKC5y4CNMW1FZeCsGJASj5Q6e6Pi6zgd1q67Fj2CuRh5Gt/JZJ/pAPLZvVIYMYuziECR/9zN8mDcLlrlzK1iM9ebaPBvPRY+HiQRhI4iRrWiwogXsAPcw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701301572; c=relaxed/simple; bh=tIe2lz5ej83+ICqRu97rViYAivV3JeSdvcLr9R07ERI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=vU552PCMPuEk7ktj8MMCM3O8EDy52OIecEcGj6qQWHfL83hARdE/uCntC0XD/2pJzxfHPFTxp5866wWEoSoeoJpIF+j9dOCZznvO4pM8bD4I7VErESWwP24DNLa7xtqBbpv03zdhHkBSYseicLfVZW6LTTlFMezNEo89o1M55FQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40838915cecso2562325e9.2 for ; Wed, 29 Nov 2023 15:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; t=1701301569; x=1701906369; darn=gcc.gnu.org; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=4JOygCm4s0wRrlKPzWeamKoTj08TujAcvws/oXeHAOU=; b=cgCZHdBqxFqfXu3EuutiwZpkViaK5W4nXRDaKyzZd9KO4gs4WKyZ6i6rIMcBnFCB8k A64IH/bgyBUS4ozBa/rC3d3z0gqOT6+EVOM4aSIiiwob5V6gh70aYAd7Caw9C2F1jv3I lMwQ5l9jYa1nnA5D31Rdj2NoFCnTB9qBtNy/pmEKDqVOIWgrlxAC+oPJRED5suSRVTKx VonsXR899NcCzajP5UeY4rtkCz9ZfMepomrUsb6Jmia0KtRxSpS34QvswIstcilZ/00L 3ZwBrYV/O+l8ZZpA1NOgBgOhq1tZH/CBM8Tba5lqn2P5BpHZORsDXdeJRBrcxPIj8l3X M3Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701301569; x=1701906369; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4JOygCm4s0wRrlKPzWeamKoTj08TujAcvws/oXeHAOU=; b=pANJFUhxOu8809Wt8n7XOX3MHl7l915RtgfmFiLHgJj2PsR3bFy1jR8KhnWiJnOLGK 6GyvtyzYf/6Wp6tJM06P9Q2czlf241g9npGJQePfQrDuEu6WK3huvSlq4xWNg0oyoPfs d7Vzpw2FyZdVLq/f/LmGKgI+pT4g3X0BKGObVh6+4s8Mh1vvjTdsdfwey3UlzT+OEtVn jCOYOxZ/M3aRBlNppL5KE9lSJc4lYu0tF47v6WJn2BDvTWliYc4oiEUGGowShJBiNhiR vvI/WEDrBXEuip3i9rdGAyY5Pp2MQRxPgmw/hARbX/vv6KIEKnPBCrp92klB+GTs1fHy zkyQ== X-Gm-Message-State: AOJu0YxGQ9LkKAaFkKuLO5KQrdaJeRmbJFOD1zRLLvv8PmZG3X7T/WL0 KihakIGiH5CeGIFBE7WpCqLIMja5F5/naOBNng4= X-Received: by 2002:a05:600c:1989:b0:405:82c0:d9d9 with SMTP id t9-20020a05600c198900b0040582c0d9d9mr12250361wmq.41.1701301568585; Wed, 29 Nov 2023 15:46:08 -0800 (PST) Received: from [192.168.0.12] (cpc87345-slou4-2-0-cust172.17-4.cable.virginm.net. [81.101.252.173]) by smtp.gmail.com with ESMTPSA id c11-20020a5d4f0b000000b00332e67d6564sm17693769wru.67.2023.11.29.15.46.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 15:46:08 -0800 (PST) Message-ID: <4b4e73fc-5f38-4c65-b055-3ee57927cb0a@jguk.org> Date: Wed, 29 Nov 2023 23:46:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jonny Grant Subject: [PATCH]: gcc/doc/extend.texi: Update builtin example for __builtin_FILE, __builtin_LINE __builtin_FUNCTION To: gcc-patches@gcc.gnu.org Content-Language: en-GB X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: 1783944025681407302 X-GMAIL-MSGID: 1783944025681407302 gcc/ChangeLog: doc/extend.texi: Update builtin example for __builtin_FILE __builtin_LINE __builtin_FUNCTION. From 66290eb477dd1a99310ad9972c45391c2a87c1c7 Mon Sep 17 00:00:00 2001 From: Jonathan Grant Date: Wed, 29 Nov 2023 11:02:06 +0000 Subject: [PATCH] gcc/doc: Update builtin example for __builtin_FILE __builtin_LINE __builtin_FUNCTION --- gcc/doc/extend.texi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 1ae589aeb29..f17a4b215de 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -14660,20 +14660,22 @@ to @var{F} or the empty string if the call was not made at function scope. For example, in the following, each call to function @code{foo} will -print a line similar to @code{"file.c:123: foo: message"} with the name +print a line similar to @code{"file.c:5: foo: message"} with the name of the file and the line number of the @code{printf} call, the name of the function @code{foo}, followed by the word @code{message}. @smallexample -const char* -function (const char *func = __builtin_FUNCTION ()) +#include + +void foo (void) @{ - return func; + printf ("%s:%i: %s: message\n", __builtin_FILE (), __builtin_LINE (), __builtin_FUNCTION ()); + printf ("%s:%i: %s: message\n", __builtin_FILE (), __builtin_LINE (), __builtin_FUNCTION ()); @} -void foo (void) +int main (void) @{ - printf ("%s:%i: %s: message\n", file (), line (), function ()); + foo(); @} @end smallexample