Fix sanitizer builds with -Wclobbered

They use GCC 10 which has some other set of false positives.
This commit is contained in:
Alexander Kuzmenkov 2022-11-02 11:12:37 +04:00 committed by Alexander Kuzmenkov
parent c54cf3ea56
commit 1847f64a2f

View File

@ -496,7 +496,8 @@ static void
check_uuid(const char *label) check_uuid(const char *label)
{ {
const MemoryContext oldcontext = CurrentMemoryContext; const MemoryContext oldcontext = CurrentMemoryContext;
const char *uuid = strchr(label, SECLABEL_DIST_TAG_SEPARATOR); /* Volatile is to work around the incorrect GCC -Wclobbered diagnostics. */
const char *volatile uuid = strchr(label, SECLABEL_DIST_TAG_SEPARATOR);
if (!uuid || strncmp(label, SECLABEL_DIST_TAG, uuid - label) != 0) if (!uuid || strncmp(label, SECLABEL_DIST_TAG, uuid - label) != 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),