guc: make dereference style consistent in check_backtrace_functions - Mailing list pgsql-hackers

From zhanghu
Subject guc: make dereference style consistent in check_backtrace_functions
Date
Msg-id CAB5m2QssN6UO+ckr6ZCcV0A71mKUB6WdiTw1nHo43v4DTW1Dfg@mail.gmail.com
Whole thread
Responses Re: guc: make dereference style consistent in check_backtrace_functions
List 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

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: tablecmds: fix bug where index rebuild loses replica identity on partitions
Next
From: Richard Guo
Date:
Subject: Convert ALL SubLinks to ANY SubLinks