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: 80994 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 236E1385DC30 for ; Wed, 29 Nov 2023 23:46:30 +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-Google-Smtp-Source: AGHT+IEPxgpE7IG0Fb0aujjyhocK3VXXSgcjxkbr8ZGeXUjQy3lwbEmVfd1dAqLt1PEcTrZKKONVgQ== 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+patchwork=sourceware.org@gcc.gnu.org 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