guc: make dereference style consistent in check_backtrace_functions

From: zhanghu <kongbaik228(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: guc: make dereference style consistent in check_backtrace_functions
Date: 2026-02-26 07:03:23
Message-ID: CAB5m2QssN6UO+ckr6ZCcV0A71mKUB6WdiTw1nHo43v4DTW1Dfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In check_backtrace_functions(), most accesses to the input string follow
the pattern (*newval)[i]. However, the empty-string check is currently
written as:

if (*newval[0] == '\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] == '\0')

This change ensures semantic clarity and maintains a consistent
dereferencing style throughout the function. No functional changes are
introduced.

Regards,
Zhang Hu

Attachment Content-Type Size
v1-0001-guc-make-dereference-style-consistent-in-check_ba.patch application/octet-stream 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-02-26 07:11:17 Convert ALL SubLinks to ANY SubLinks
Previous Message Chao Li 2026-02-26 06:59:58 Re: tablecmds: fix bug where index rebuild loses replica identity on partitions