From patchwork Wed Jan 10 21:28:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonny Grant X-Patchwork-Id: 83798 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9CAFA386F82E for ; Wed, 10 Jan 2024 21:30:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id B109B3883006 for ; Wed, 10 Jan 2024 21:28:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B109B3883006 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 B109B3883006 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704922093; cv=none; b=vpr0ouZrCgJRY9ePvEOkejejGfuoxf1oTnkT1JleeDvLzzXmEhyFHyBov9cCO9mKdQI5PabuCJZKtSI8Ukl71/ZoTelltxEYVhqZZzNNVMclt9xW7WpPpNfUM6DBg9+gLsVMcQMAznpA8aKcFWS4f7qjnCz4qPzATql+fWSh/gI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704922093; c=relaxed/simple; bh=sBRCeMMwQfW5tU1NpZFuMyMmL6ixMqJXluI5xoIUqaI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=YUoSR0i4HQ5IfXOK6fuZ8+2X9Ol8gzpIRG4yEdGwi5ef0/G1OaYKo7aDG0s0JZi6KJuG05b3sOccGjtoY+ANiqJbWKRWrpIqwneBNxRYiKMOkUIxgFnJY7uZzQ66dZjqV+7iG9qNdGPngghZ8urbDQ9jO7LCHmHVnML1BXmIMfQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-336746c7b6dso4049837f8f.0 for ; Wed, 10 Jan 2024 13:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; t=1704922090; x=1705526890; 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=d+5X2TAGghi56DK6uzg/c39Lk3+jxzPRzYQZ99wIehc=; b=qP3g8LwnbJd/mTwKce35c510eclr0nJxRDdcuL9MGphOR9cEOWo++bFd2QnshT4rmy OerVO8mkSuDkMaouXHq0UH0yiV1R4ef0Wax3hoT8YNksGH1ibPof/1uLdyin9t2GWalr 8Uvx4Oyyxwwj0jZhCluFbvuV0YyOFy3er+44/Aj3oXKckNDW72wG0SIdBCWJsfdr8cIq 3ixZQ5W/LmNUudN4lwzAcW3op50j/sweADjGm5KtB7n9Lo8Z5Ip9w8/M+Um1z8A3uL+z 3i+ixWBV0h7mFrrmxTWBGkkc1Ln4ynM9Iw+JZiqHUpNFUp20LWg3Mr3hPekFuD4Ro8aN 0Ijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704922090; x=1705526890; 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=d+5X2TAGghi56DK6uzg/c39Lk3+jxzPRzYQZ99wIehc=; b=VXrTe55deDh/mcziiCu66R3A/Wyi0XamfmNVMvBb/wZIc/QPWlE0x5OY5ROEGu8JTL nKR2d1gokH3ByvkjGs0P++qhsYJLU+6ztnfWDWkq117vLGaqxXAjb4KYhhtXDKjSAUEc FtHSkbd/7Pz0WbflRx24/rIBAMr65NUNXs7YkeRYG0fHi2B6Uxh8WBVIc0zMNG6CLoW6 P+Zwn3oedh/mAldv7+PKgS4l0JN4ToDihHaeIc9V5RFLXIEucvjKHHShpt3s0wLmOa4a k0kxD+LXxaMJQ7n2IyO+3ndA6EE54khOf16dh4S8bglGP7JYnEatNydXH+EgzTcrq6Qu I9aw== X-Gm-Message-State: AOJu0Yy1yUa2SBOe4Bhi9hTobnKqPjxJwFbI4qAUSDvtyFJglBipFS2u HLtzfcVQhSv6Ut2CcMs//z/Ku5tfSeuXkgXB3nt8njDKMPg= X-Google-Smtp-Source: AGHT+IF6rFTnJMumrrZgWnLSKG9asQK7yMDGdgicHiJElrPful0mgB/meysjeFEAYHAFN876By+3eQ== X-Received: by 2002:a5d:590b:0:b0:337:7086:b6c7 with SMTP id v11-20020a5d590b000000b003377086b6c7mr56646wrd.19.1704922090423; Wed, 10 Jan 2024 13:28:10 -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 b6-20020a5d6346000000b0033667867a66sm5717119wrw.101.2024.01.10.13.28.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 13:28:10 -0800 (PST) Message-ID: <74e2f370-c3ec-4bdb-a9a5-fe037797a7d1@jguk.org> Date: Wed, 10 Jan 2024 21:28:09 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jonny Grant Subject: [PATCH v2]: 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.1 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+patchwork=sourceware.org@gcc.gnu.org 2024-01-10 Jonathan Grant 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 Signed-off-by: Jonathan Grant --- 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