From patchwork Wed Feb 7 14:58:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonny Grant X-Patchwork-Id: 85428 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 357D438582B1 for ; Wed, 7 Feb 2024 14:59:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 873F93858417 for ; Wed, 7 Feb 2024 14:58:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 873F93858417 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 873F93858417 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707317938; cv=none; b=uIJvK1VKwhJKJajXDYgfdNVZ9DBV2EFhSZ/oouO7tw6zGqJ+k4sWTyJwHFuHJGySfQ0B83uKe0tIUruDIcEYwKd87sdnWoKRZ4LniZLpYpDxwUKqOXJM1jq9vh71TJEzUqiVH8pXhOIObmhpfQs5vtAG+vgv1E7tBPJ4GkeRipE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707317938; c=relaxed/simple; bh=fwI/+/rMWbpsDGpF8hu5ekSBth7zIm4kqlx32XYuOJo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=fwEgiE09IcYfVptOu1KgWitNU4tDiW2g7hrHr4gQ+O8KXX8/z/uOoxRjaQDwld2HjdqP0rghqXC7qDyMwKWZnlqraPW6v0hLp32Ko/WfYwwV7LBtECMMWWQsHTFjSbpzLNDYsDehnspczIT5EhrKsvNcMcZ7LSyhpIdcEK2w8kI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40fff96d5d7so6187625e9.2 for ; Wed, 07 Feb 2024 06:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; t=1707317935; x=1707922735; darn=gcc.gnu.org; h=content-transfer-encoding:to:content-language:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cH2rt5YvjAss+u+B3mm8ZSKj8XIltMRtXpL3L/xniko=; b=iUAx/eK6CCDFEW1PJLoi4E+TzSZBC1Jrl01ro8bM5IKWl9Hk3AXdBi62cFXEImB+ut LDNlCoYmxtHdWOHq9w432q6oEsvXdUG/yW1m1UBsfnqAJPyW6YcDhm02xipS4F1ZvARu 8RN2iM6jb7VYXFiXPDcXXV/qEYSsgJkago68iJsy8XrwKio3rMHB29d98ACEK1lN9bXw 0jKx4UUZxynr+xHIPRMYUxJ+cCkmYxioBSNM27guE3JCdWRiq83TWY8Q+mHp1iWNksqB EH/iIbiztrJYKJ19ULDB2xD6a5NRNAQhf8pvlI2e7lqhvxS3uJEgRjunw96n3oR2HuF6 XO9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707317935; x=1707922735; h=content-transfer-encoding:to:content-language:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cH2rt5YvjAss+u+B3mm8ZSKj8XIltMRtXpL3L/xniko=; b=M1XrPgPHI2DgHSrziaKgWGj23p6hFYS+Ir4pY04i832d+VPSUbWayhtlVBV2p5Ep7Q MotYCdFPDbnWEJ2GaK5WVTCQu5QUSv3BhpjVgsI+r82l96HVzi2/l85jydMdb92MiUlv wUosgEbxsgWxqM+3/cpwGpoikFCyhnr6OLi43lhB3URZqiNMtgTf1HtMTfKllxgSjGdZ umPGAlT0+G1xICRd14aENQJxZldyf0X3Wgsm0J/nRnulX8xGFk6JY1sP5cr+GYwOBo7V zi2D6Q57iCfMVg3B+VBFBfJ7EgSGMkCoUabaQrhiTz1DO1NkIMBP66dOnE8NTtadINA5 Hw3Q== X-Gm-Message-State: AOJu0YxBKG616PWxJ1nUMkG4UFswrNw3kYMpiZDOq2HWdFkCc2y+Yjd9 V0mpgFJx/81QabkU+0Mwhc8aoBeqt8jcAH2YuttJ4RzP8jz2vXzsZp1cCYDnZxNPg1sw/EMMm2o x X-Google-Smtp-Source: AGHT+IGaffDJyJXorNE87SJi0QYPOCaFjMQRQD4CJW54gMvKiyCjVIkiT3VoGWxiwxq66T3MUWETwA== X-Received: by 2002:a05:600c:1c21:b0:40d:3fee:97f6 with SMTP id j33-20020a05600c1c2100b0040d3fee97f6mr4663782wms.34.1707317935322; Wed, 07 Feb 2024 06:58:55 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVapOr2wI1dPd2Eh2v6gcXV6JyjVQVlNB9jzoc3MXWo80t91YaZbB3qBQGMlaW2xoWtofXOg4LBRuzFRCVNChISTdzI1wIm8s77Ni3Q++mxIXBjqKM= Received: from [192.168.0.12] (cpc87309-slou4-2-0-cust122.17-4.cable.virginm.net. [94.173.148.123]) by smtp.gmail.com with ESMTPSA id n30-20020a05600c501e00b004101bdae3a0sm1171843wmr.38.2024.02.07.06.58.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Feb 2024 06:58:55 -0800 (PST) Message-ID: Date: Wed, 7 Feb 2024 14:58:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jonny Grant Subject: [PATCH v3]: gcc/doc/extend.texi: Update builtin descriptions for __builtin_FILE, __builtin_LINE __builtin_FUNCTION Content-Language: en-GB To: gcc-patches@gcc.gnu.org, Sandra Loosemore X-Spam-Status: No, score=-10.3 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-02-07 Jonathan Grant gcc/ChangeLog: * doc/extend.texi: Update builtin descriptions for __builtin_FILE __builtin_LINE __builtin_FUNCTION. From 9e0b662b5b036f37d7ca90db607bacbb0012e8b3 Mon Sep 17 00:00:00 2001 From: Jonathan Grant Date: Wed, 7 Feb 2024 14:51:34 +0000 Subject: [PATCH] gcc/doc/extend.texi: Update builtin descriptions for __builtin_FILE, __builtin_LINE __builtin_FUNCTION Signed-off-by: Jonathan Grant --- gcc/doc/extend.texi | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 2b8ba1949bf..124cca1e208 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -15202,34 +15202,29 @@ and returns an address constant pointing to the name of the function from which the built-in was invoked, or the empty string if the invocation is not at function scope. When used as a C++ default argument for a function @var{F}, it returns the name of @var{F}'s -caller or the empty string if the call was not made at function -scope. +caller. @enddefbuiltin @defbuiltin{{const char *} __builtin_FILE ()} This function is the equivalent of the preprocessor @code{__FILE__} macro and returns an address constant pointing to the file name -containing the invocation of the built-in, or the empty string if -the invocation is not at function scope. When used as a C++ default +containing the invocation of the built-in, or an empty string if +the invocation is not at file scope. When used as a C++ default argument for a function @var{F}, it returns the file name of the call -to @var{F} or the empty string if the call was not made at function -scope. +to @var{F}. -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 -of the file and the line number of the @code{printf} call, the name of +In the following example, each call to function @code{foo} +prints a line similar to @code{"file.c:123: foo: message"} with the +file and 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 ()) -@{ - return func; -@} +#include void foo (void) @{ - printf ("%s:%i: %s: message\n", file (), line (), function ()); + printf ("%s:%i: %s: message\n", __builtin_FILE (), __builtin_LINE (), + __builtin_FUNCTION ()); @} @end smallexample