Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b047cc

Browse files
committed
Fix type confusion in guc_var_compare()
Before this change guc_var_compare() cast the input arguments toconst struct config_generic *. That's not quite right however, as the inputon one side is often just a char * on one side.Instead just use char *, the first field in config_generic.This fixes a -Warray-bounds warning with some versions of gcc. While thewarning is only known to be triggered for <= 15, the issue the warning pointsout seems real, so apply the fix everywhere.Author: Nazir Bilal Yavuz <byavuz81@gmail.com>Reported-by: Erik Rijkers <er@xs4all.nl>Suggested-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/a74a1a0d-0fd2-3649-5224-4f754e8f91aa%40xs4all.nl
1 parent34f457e commit9b047cc

File tree

1 file changed

+3
-3
lines changed
  • src/backend/utils/misc

1 file changed

+3
-3
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,10 +1289,10 @@ find_option(const char *name, bool create_placeholders, bool skip_errors,
12891289
staticint
12901290
guc_var_compare(constvoid*a,constvoid*b)
12911291
{
1292-
conststructconfig_generic*confa=*(structconfig_generic*const*)a;
1293-
conststructconfig_generic*confb=*(structconfig_generic*const*)b;
1292+
constchar*namea=**(constchar**const*)a;
1293+
constchar*nameb=**(constchar**const*)b;
12941294

1295-
returnguc_name_compare(confa->name,confb->name);
1295+
returnguc_name_compare(namea,nameb);
12961296
}
12971297

12981298
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp