Skip to content

Commit 6e545aa

Browse files
authored
Fix the -O0 configuration and its warnings (#557)
1 parent a678783 commit 6e545aa

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: ./autogen.sh
2222

2323
- name: Configure
24-
run: ./configure CC='gcc -O0 -fsanitize=undefined,address -fsanitize-undefined-trap-on-error' CPPFLAGS='-Wall -Wextra -Werror -Wno-error=unused-but-set-parameter' --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug --with-link-size=4
24+
run: ./configure CC='gcc' CFLAGS='-O0 -fsanitize=undefined,address -fsanitize-undefined-trap-on-error' CPPFLAGS='-Wall -Wextra -Werror -Wno-error=unused-but-set-parameter' --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug --with-link-size=4
2525

2626
- name: Build
2727
run: make -j3

src/pcre2_auto_possess.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ for(;;)
11441144
}
11451145

11461146
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
1147+
return FALSE; /* Avoid compiler warnings */
11471148
}
11481149

11491150

src/pcre2_compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7891,6 +7891,7 @@ for (;; pptr++)
78917891
} /* End of big loop */
78927892

78937893
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
7894+
return 0; /* Avoid compiler warnings */
78947895
}
78957896

78967897

@@ -8197,6 +8198,7 @@ for (;;)
81978198
}
81988199

81998200
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
8201+
return 0; /* Avoid compiler warnings */
82008202
}
82018203

82028204

src/pcre2_study.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ for (;;)
761761
}
762762

763763
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
764+
return -3; /* Avoid compiler warnings */
764765
}
765766

766767

0 commit comments

Comments
 (0)