diff options
| author | Paul Eggert | 2011-03-06 12:15:10 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-03-06 12:15:10 -0800 |
| commit | dba6549815e211c820a249cbfe857a92c7418896 (patch) | |
| tree | c95216ec1eb0934a04389ccbd79ddd462ddb2eec /src | |
| parent | 9f36b9fd38fb4bde2ac4664f05a65e2dd973add2 (diff) | |
| download | emacs-dba6549815e211c820a249cbfe857a92c7418896.tar.gz emacs-dba6549815e211c820a249cbfe857a92c7418896.zip | |
* xdisp.c (display_line): Mark variables that gcc -Wuninitialized cannot
deduce are never used uninitialized.
* lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c
which in turn is copied from coreutils.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/lisp.h | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
3 files changed, 20 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8582bf67e04..23bf646f742 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -4,6 +4,10 @@ | |||
| 4 | Add a FIXME comment, since the code still doesn't look right. | 4 | Add a FIXME comment, since the code still doesn't look right. |
| 5 | (Fcurrent_bidi_paragraph_direction): Simplify slightly; this | 5 | (Fcurrent_bidi_paragraph_direction): Simplify slightly; this |
| 6 | avoids a gcc -Wuninitialized diagnostic. | 6 | avoids a gcc -Wuninitialized diagnostic. |
| 7 | (display_line): Mark variables that gcc -Wuninitialized cannot | ||
| 8 | deduce are never used uninitialized. | ||
| 9 | * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c | ||
| 10 | which in turn is copied from coreutils. | ||
| 7 | 11 | ||
| 8 | current_column: Now returns EMACS_INT, fixing some iftc. | 12 | current_column: Now returns EMACS_INT, fixing some iftc. |
| 9 | * bytecode.c (Fbyte_code): Don't cast current_column () to int. | 13 | * bytecode.c (Fbyte_code): Don't cast current_column () to int. |
diff --git a/src/lisp.h b/src/lisp.h index e38d6a8ec3c..719d72d28a4 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3524,6 +3524,13 @@ extern void init_system_name (void); | |||
| 3524 | && (circular_list_error ((list)), 1))) \ | 3524 | && (circular_list_error ((list)), 1))) \ |
| 3525 | : 0))) | 3525 | : 0))) |
| 3526 | 3526 | ||
| 3527 | /* Use this to suppress gcc's `...may be used before initialized' warnings. */ | ||
| 3528 | #ifdef lint | ||
| 3529 | # define IF_LINT(Code) Code | ||
| 3530 | #else | ||
| 3531 | # define IF_LINT(Code) /* empty */ | ||
| 3532 | #endif | ||
| 3533 | |||
| 3527 | /* The ubiquitous min and max macros. */ | 3534 | /* The ubiquitous min and max macros. */ |
| 3528 | 3535 | ||
| 3529 | #ifdef max | 3536 | #ifdef max |
diff --git a/src/xdisp.c b/src/xdisp.c index 174312ccab3..180c65d18ed 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17231,14 +17231,16 @@ display_line (struct it *it) | |||
| 17231 | struct glyph_row *row = it->glyph_row; | 17231 | struct glyph_row *row = it->glyph_row; |
| 17232 | Lisp_Object overlay_arrow_string; | 17232 | Lisp_Object overlay_arrow_string; |
| 17233 | struct it wrap_it; | 17233 | struct it wrap_it; |
| 17234 | int may_wrap = 0, wrap_x; | 17234 | int may_wrap = 0, wrap_x IF_LINT (= 0); |
| 17235 | int wrap_row_used = -1, wrap_row_ascent, wrap_row_height; | 17235 | int wrap_row_used = -1; |
| 17236 | int wrap_row_phys_ascent, wrap_row_phys_height; | 17236 | int wrap_row_ascent IF_LINT (= 0), wrap_row_height IF_LINT (= 0); |
| 17237 | int wrap_row_extra_line_spacing; | 17237 | int wrap_row_phys_ascent IF_LINT (= 0), wrap_row_phys_height IF_LINT (= 0); |
| 17238 | EMACS_INT wrap_row_min_pos, wrap_row_min_bpos; | 17238 | int wrap_row_extra_line_spacing IF_LINT (= 0); |
| 17239 | EMACS_INT wrap_row_max_pos, wrap_row_max_bpos; | 17239 | EMACS_INT wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0); |
| 17240 | EMACS_INT wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0); | ||
| 17240 | int cvpos; | 17241 | int cvpos; |
| 17241 | EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos; | 17242 | EMACS_INT min_pos = ZV + 1, max_pos = 0; |
| 17243 | EMACS_INT min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0); | ||
| 17242 | 17244 | ||
| 17243 | /* We always start displaying at hpos zero even if hscrolled. */ | 17245 | /* We always start displaying at hpos zero even if hscrolled. */ |
| 17244 | xassert (it->hpos == 0 && it->current_x == 0); | 17246 | xassert (it->hpos == 0 && it->current_x == 0); |