Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvZAh-0089Pe-2G for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 11:04:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvZAg-00C0HF-1o for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 11:04:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvZAg-00C0H7-0n for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 11:04:42 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvZAc-00000001Hcn-42Rb for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 11:04:41 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-b936331787bso45418266b.3 for ; Thu, 26 Feb 2026 03:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772103877; cv=none; d=google.com; s=arc-20240605; b=ODb+Fpv4NohbvKjzJEzW+1kNVu+w0y4Ewsi6tY+NfkL0cbuScLPTvwuUPVJ4SpV1hm 3lKXTQlJFINXOBom8rr/WT5dfxu3xoJjjYQx+iKpRAnxWH7H5H66jhs30vz8A4Y8rj/0 Rd90ZriI+CffikNnNpj4XtnaTWz5OkINnZIfI97isRyGN+7Iez56Eq80ywAifVaTgsiV AhtOKDfWNW7C5aYAk9b44G8uZFqXgNn6cV6rd6Hv9QeLpIOTfBzMYGpVimnwJKf/pqpX Txwz+B9nsDD+Z2WkRSw7eJkmxVrvuFRXIAofzLVN0CjgpFPR3QCocLlX3Zwl5rqP3SHl XWDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KaNi9E+SthocsMW4fr1Ak1m/+XmoZEufGasBxN2Ek+I=; fh=G8h7G6LO4h18h75g+2QnkIcSd9JgSAQONU1Yy1crqWE=; b=NqCTKxag07JNPienpERoSFsm3k/i4gjdFFyH89B4BKJMQ3cVu3aWjZ2z6jMAY/tIam rnRrecsJzlCDwcaQTNRvVc0lZLbHN74lTX9teAyDysws23htgsvcrilrg3zaUrP2yLdx 1eY9ffnzypvLgl952FPQfR+Qyj7j/3PyWwz2CMwOvZulHQlT8N3Dkszk9GN1Umy870Op 2Dw05nf0CEjty805QUCmmGCq2ezlIMFBzGPuHwohUnswU1dPetsXfkVCRwRkSJnVE+Gt BLB1JO8qWp8C2vTIu1Wshn607OkVxqMc0c2k8obWOoZNm72oGhb8konA+YKJbEQIFfjb lRVQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772103877; x=1772708677; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KaNi9E+SthocsMW4fr1Ak1m/+XmoZEufGasBxN2Ek+I=; b=FnHUUYpAWr69IyzT7vLdZiKQwt9yQ8MVCXYqx2kTPYpdvWQO/d8LBHshyQmrXIxxh8 JN8/Dfr8WAlRo4y0wj3zsVMf+iYOzCq8n39Way+Zte9tQuCgViAv2uQLivhsKwO/rVOq 0FTr3uDLBwir89O8yBvzV+noJqrKoDpY0Ub3EDGZoY5qEes9JrpKX/SxvmsvnLO5WFJH Isdx750Pbong+Ku6uF9UkNzOYMuUAzWAz6pjIfar7F+/Z60u47KVgPdTOZ2GvUQKu7fF +hXz+lr7d8q0ge2d5OXq4Q+jf8AEkTjSafx8ok2a0COvCeuNZiVj3hT/mswOvcC1cmJ1 ToDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772103877; x=1772708677; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KaNi9E+SthocsMW4fr1Ak1m/+XmoZEufGasBxN2Ek+I=; b=TVXisePib8x1vjuPmVE+uNLoRkqrtAmiHTqUWTxU/8H2ZQASwoT28PISuMbsFCzgRk j2R9IbqAUHZXY94bxucXunQi2z6MUE0U5Wbyyefn56/Y0OGQ9F1J6/ZbUHfcDRXSAx+n Fc6qS22533mMnRESRrK1w/5oqrlwke6vAfyo0cjE99YJ8jBXnkdPRiMaSpCCwf7cI/cn UtUmyNORQ8t3+WoD6r76qX37Q2X3OjdDmwSJD8g6Bkt6fYTB91KknUDyr7HgxiDFlBR2 9rNF3qf6TxZTafh5aMYeHMidvsnyJF/abGq0sKPDg5O8CNRCW3AUnpZq9odSQF9mt6kh 333Q== X-Forwarded-Encrypted: i=1; AJvYcCUhx1Pi5kWFYQOaWd4z9Xw+SKs7ViPyum4xlt7tzEqV21J84323KpyaVHl7+OXOrtHBeuZarWg8FX/8k9nQ@lists.postgresql.org X-Gm-Message-State: AOJu0YxUiXobBBRWbFiC9dooZgvPSNjXZ+vVctaYce//Qhx1El//BTg1 EoQNx8l0C+s97HMIIKWceHo2IeDCKdD2QS8hALBDxih5X/Y8aGjIaxSmTcJxu/TObNiBLFnYFjL ZzLL4zGlqf4JVb3sJehU8Lq8tLycS2YU= X-Gm-Gg: ATEYQzxcsolKh83lu7cegRI9fI/gu84y6n5DW0FlXL5DrPpbVmlqr9RVww5klEMvs+B 8SpfQa5JQCv4JCvDUI55QySdhEoEN5L/FaiYVlfq3ah5Dj3XObwpq5wfz+h9a5L+7fXwjKJ4ezq S+ox0+qSz5ljiuIyH/7VDokJmk37s2sxDbwPZix8O8popvd9tNa2msoOmmENs6aCfR4zmxHZFwG wV0l2MuHbUbwONBjtSi0bJOydBbHkTIMJn4nnprKBEwabhcptCN1zcS9z8xeOgoNKnFDW7fUZ6s r06izLsWUVBmotMcyrhS2I6juEwKIaLkMzFck49GR+2qvA/2mj9c8OvCJfLWPOZPzLKWVf1dyvQ P1HgL X-Received: by 2002:a17:907:948c:b0:b83:1349:3a7 with SMTP id a640c23a62f3a-b908194c304mr1281449266b.10.1772103877020; Thu, 26 Feb 2026 03:04:37 -0800 (PST) MIME-Version: 1.0 References: <08805314-299A-4941-B63E-4CC3E144E0E7@gmail.com> In-Reply-To: <08805314-299A-4941-B63E-4CC3E144E0E7@gmail.com> From: Junwang Zhao Date: Thu, 26 Feb 2026 19:04:24 +0800 X-Gm-Features: AaiRm51o5DrKaZrz1VVWVBFYZ6C3llbJDWYmrzawKUZX-01JqcSN8OChaIF8Wrs Message-ID: Subject: Re: guc: make dereference style consistent in check_backtrace_functions To: Chao Li Cc: zhanghu , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 26, 2026 at 5:21=E2=80=AFPM Chao Li wr= ote: > > > > > On Feb 26, 2026, at 15:03, zhanghu wrote: > > > > Hi, > > > > In check_backtrace_functions(), most accesses to the input string follo= w the pattern (*newval)[i]. However, the empty-string check is currently wr= itten as: > > > > if (*newval[0] =3D=3D '\0') > > > > While functionally correct due to how the compiler handles the address-= of-address context here, this form is semantically misleading. It relies on= implicit operator precedence rather than explicit intent. > > > > The attached patch rewrites it as: > > > > if ((*newval)[0] =3D=3D '\0') > > > > This change ensures semantic clarity and maintains a consistent derefer= encing style throughout the function. No functional changes are introduced. > > > > Regards, > > Zhang Hu > > > > This is an interesting find. > > [] has higher precedence than *, so: > > - (*newval)[i] means to get the first string, then get the char at posit= ion i > - *newval[i] means to get the array element at position i, then get the = first char > > When i is 0, (*newval)[0] and *newval[0] happen to yield the same result,= so this isn't a functional bug. > > However, in the GUC context, newval is a point to a string rather than a = two-dimension char array, *newval[i] is meaningless, so +1 for fixing this= to improve readability. +1 The double pointer indicates an output parameter, the commit message should be adjusted though. > > Best regards, > -- > Chao Li (Evan) > HighGo Software Co., Ltd. > https://www.highgo.com/ > > > > > > --=20 Regards Junwang Zhao