diff options
| author | Paul Eggert | 2016-02-26 08:22:36 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-02-26 08:23:26 -0800 |
| commit | e35f99f2dd35a89b42961fc63c7e2772fb03c792 (patch) | |
| tree | 42737bbd0e7f64d9b6840516b202f0aa914db098 /src/regex.c | |
| parent | 9583b9e871f89bdc1bf30c24a2090c08ed87e1b5 (diff) | |
| download | emacs-e35f99f2dd35a89b42961fc63c7e2772fb03c792.tar.gz emacs-e35f99f2dd35a89b42961fc63c7e2772fb03c792.zip | |
--enable-gcc-warnings now uses -Wjump-misses-init
When configuring with --enable-gcc-warnings, also enable
-Wjump-misses-init, as it’s confusing to use a goto to skip over
an initialization. Fix the few places in the code that run afoul
of this warning.
* configure.ac (WERROR_CFLAGS): Add -Wjump-misses-init.
* src/doc.c (Fsubstitute_command_keys):
* src/image.c (svg_load_image):
* src/regex.c (re_match_2_internal):
* src/xdisp.c (redisplay_internal, redisplay_window):
Don’t jump over initialization.
Diffstat (limited to 'src/regex.c')
| -rw-r--r-- | src/regex.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/regex.c b/src/regex.c index 164eb4612ae..d5c58aeaf8b 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -5140,8 +5140,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5140 | 5140 | ||
| 5141 | if (p == pend) | 5141 | if (p == pend) |
| 5142 | { | 5142 | { |
| 5143 | ptrdiff_t dcnt; | ||
| 5144 | |||
| 5145 | /* End of pattern means we might have succeeded. */ | 5143 | /* End of pattern means we might have succeeded. */ |
| 5146 | DEBUG_PRINT ("end of pattern ... "); | 5144 | DEBUG_PRINT ("end of pattern ... "); |
| 5147 | 5145 | ||
| @@ -5149,19 +5147,22 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5149 | longest match, try backtracking. */ | 5147 | longest match, try backtracking. */ |
| 5150 | if (d != end_match_2) | 5148 | if (d != end_match_2) |
| 5151 | { | 5149 | { |
| 5152 | /* 1 if this match ends in the same string (string1 or string2) | 5150 | /* True if this match is the best seen so far. */ |
| 5153 | as the best previous match. */ | 5151 | bool best_match_p; |
| 5154 | boolean same_str_p = (FIRST_STRING_P (match_end) | 5152 | |
| 5155 | == FIRST_STRING_P (d)); | 5153 | { |
| 5156 | /* 1 if this match is the best seen so far. */ | 5154 | /* True if this match ends in the same string (string1 |
| 5157 | boolean best_match_p; | 5155 | or string2) as the best previous match. */ |
| 5158 | 5156 | bool same_str_p = (FIRST_STRING_P (match_end) | |
| 5159 | /* AIX compiler got confused when this was combined | 5157 | == FIRST_STRING_P (d)); |
| 5160 | with the previous declaration. */ | 5158 | |
| 5161 | if (same_str_p) | 5159 | /* AIX compiler got confused when this was combined |
| 5162 | best_match_p = d > match_end; | 5160 | with the previous declaration. */ |
| 5163 | else | 5161 | if (same_str_p) |
| 5164 | best_match_p = !FIRST_STRING_P (d); | 5162 | best_match_p = d > match_end; |
| 5163 | else | ||
| 5164 | best_match_p = !FIRST_STRING_P (d); | ||
| 5165 | } | ||
| 5165 | 5166 | ||
| 5166 | DEBUG_PRINT ("backtracking.\n"); | 5167 | DEBUG_PRINT ("backtracking.\n"); |
| 5167 | 5168 | ||
| @@ -5290,7 +5291,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5290 | nfailure_points_pushed - nfailure_points_popped); | 5291 | nfailure_points_pushed - nfailure_points_popped); |
| 5291 | DEBUG_PRINT ("%u registers pushed.\n", num_regs_pushed); | 5292 | DEBUG_PRINT ("%u registers pushed.\n", num_regs_pushed); |
| 5292 | 5293 | ||
| 5293 | dcnt = POINTER_TO_OFFSET (d) - pos; | 5294 | ptrdiff_t dcnt = POINTER_TO_OFFSET (d) - pos; |
| 5294 | 5295 | ||
| 5295 | DEBUG_PRINT ("Returning %td from re_match_2.\n", dcnt); | 5296 | DEBUG_PRINT ("Returning %td from re_match_2.\n", dcnt); |
| 5296 | 5297 | ||