The following bug has been logged on the website: Bug reference: 19066 Logged by: David Binderman Email address: dcb314@hotmail.com PostgreSQL version: 18.0 Operating system: fedora 42 Description: Static analyser cppcheck says: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86:22: style: Array index 'j' is used before limits check. [arrayIndexThenCheck] Source code is while ((city_table[j].select_list == -1) && (j < num_gene)) Suggest new source code while ((j < num_gene) && (city_table[j].select_list == -1))
PG Bug reporting form <noreply@postgresql.org> writes:
> Static analyser cppcheck says:
> postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86:22: style: Array
> index 'j' is used before limits check. [arrayIndexThenCheck]
Did your static analyzer not notice that this dead code is
not even compiled? I don't have a lot of faith in analyzers
that ignore #ifdefs.
(It's fair to ask why we haven't removed this code altogether
... laziness I guess, or waiting for something better than
GEQO to come along. But expending effort on fixing it
is definitely not in the cards.)
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера