diff options
| author | Paul Eggert | 2026-03-01 11:29:31 -0800 |
|---|---|---|
| committer | Paul Eggert | 2026-03-01 11:36:47 -0800 |
| commit | 6e8dd0f898dccde926a4e6ecee22b39eaf21472d (patch) | |
| tree | 4ec44cf83d586861c6ba264f2e135285d2a50ea5 /lib-src | |
| parent | 381eb4985b7854747cb1102232d801abd98948f6 (diff) | |
| download | emacs-6e8dd0f898dccde926a4e6ecee22b39eaf21472d.tar.gz emacs-6e8dd0f898dccde926a4e6ecee22b39eaf21472d.zip | |
Pacify clang -Wunused-result
Problem reported by badli al rashid (bug#80512).
* lib-src/make-docfile.c (scan_c_stream): Avoid a tricky ungetc+getc.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/make-docfile.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index d71a0aaa9cb..f6e321d876a 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -387,8 +387,9 @@ scan_keyword_or_put_char (char ch, struct rcsoc_state *state) | |||
| 387 | 387 | ||
| 388 | 388 | ||
| 389 | /* Skip a C string or C-style comment from INFILE, and return the | 389 | /* Skip a C string or C-style comment from INFILE, and return the |
| 390 | byte that follows, or EOF. COMMENT means skip a comment. If | 390 | byte that follows, or EOF. COMMENT means skip a comment. |
| 391 | PRINTFLAG is positive, output string contents to stdout. If it is | 391 | Leading '"' or '/','*' have already been read. |
| 392 | If PRINTFLAG is positive, output string contents to stdout. If it is | ||
| 392 | negative, store contents in buf. Convert escape sequences \n and | 393 | negative, store contents in buf. Convert escape sequences \n and |
| 393 | \t to newline and tab; discard \ followed by newline. | 394 | \t to newline and tab; discard \ followed by newline. |
| 394 | If SAW_USAGE is non-null, then any occurrences of the string "usage:" | 395 | If SAW_USAGE is non-null, then any occurrences of the string "usage:" |
| @@ -1160,19 +1161,13 @@ scan_c_stream (FILE *infile) | |||
| 1160 | } | 1161 | } |
| 1161 | } | 1162 | } |
| 1162 | 1163 | ||
| 1163 | if (c == '"' | 1164 | bool comment = c == '/' && (c = getc (infile)) == '*'; |
| 1164 | || (c == '/' | 1165 | if (comment || c == '"') |
| 1165 | && (c = getc (infile), | ||
| 1166 | ungetc (c, infile), | ||
| 1167 | c == '*'))) | ||
| 1168 | { | 1166 | { |
| 1169 | bool comment = c != '"'; | ||
| 1170 | bool saw_usage; | 1167 | bool saw_usage; |
| 1171 | 1168 | ||
| 1172 | printf ("\037%c%s\n", defvarflag ? 'V' : 'F', input_buffer); | 1169 | printf ("\037%c%s\n", defvarflag ? 'V' : 'F', input_buffer); |
| 1173 | 1170 | ||
| 1174 | if (comment) | ||
| 1175 | getc (infile); /* Skip past `*'. */ | ||
| 1176 | c = read_c_string_or_comment (infile, 1, comment, &saw_usage); | 1171 | c = read_c_string_or_comment (infile, 1, comment, &saw_usage); |
| 1177 | 1172 | ||
| 1178 | /* If this is a defun, find the arguments and print them. If | 1173 | /* If this is a defun, find the arguments and print them. If |