summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-22 13:50:09 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-22 20:51:15 (GMT)
commit71817dc37c9c9013e475c856aec95a5fb27bce46 (patch)
tree29628782e5899744fc9480f15316f6cadd91d919 /Source/CursesDialog
parent04b0d5c86291d14f485d1046957a6fcd22d65bee (diff)
downloadCMake-71817dc37c9c9013e475c856aec95a5fb27bce46.zip
CMake-71817dc37c9c9013e475c856aec95a5fb27bce46.tar.gz
CMake-71817dc37c9c9013e475c856aec95a5fb27bce46.tar.bz2
ccmake: Tell clang-analyzer a loop body runs at least once
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/form/frm_def.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/CursesDialog/form/frm_def.c b/Source/CursesDialog/form/frm_def.c
index 645b3ba..569057b 100644
--- a/Source/CursesDialog/form/frm_def.c
+++ b/Source/CursesDialog/form/frm_def.c
@@ -220,6 +220,10 @@ static int Connect_Fields(FORM * form, FIELD ** fields)
for(page_nr = 0;page_nr < form->maxpage; page_nr++)
{
FIELD *fld = (FIELD *)0;
+ #ifdef __clang_analyzer__
+ /* Tell clang-analyzer the loop body runs at least once. */
+ assert(form->page[page_nr].pmin <= form->page[page_nr].pmax);
+ #endif
for(j = form->page[page_nr].pmin;j <= form->page[page_nr].pmax;j++)
{
fields[j]->index = j;