summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2026-03-01 11:29:31 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2026-03-01 11:36:47 -0800
commit6e8dd0f898dccde926a4e6ecee22b39eaf21472d (patch)
tree4ec44cf83d586861c6ba264f2e135285d2a50ea5 /lib-src
parent381eb4985b7854747cb1102232d801abd98948f6 (diff)
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.c15
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)
/* Skip a C string or C-style comment from INFILE, and return the
- byte that follows, or EOF. COMMENT means skip a comment. If
- PRINTFLAG is positive, output string contents to stdout. If it is
+ byte that follows, or EOF. COMMENT means skip a comment.
+ Leading '"' or '/','*' have already been read.
+ If PRINTFLAG is positive, output string contents to stdout. If it is
negative, store contents in buf. Convert escape sequences \n and
\t to newline and tab; discard \ followed by newline.
If SAW_USAGE is non-null, then any occurrences of the string "usage:"
@@ -1160,19 +1161,13 @@ scan_c_stream (FILE *infile)
}
}
- if (c == '"'
- || (c == '/'
- && (c = getc (infile),
- ungetc (c, infile),
- c == '*')))
+ bool comment = c == '/' && (c = getc (infile)) == '*';
+ if (comment || c == '"')
{
- bool comment = c != '"';
bool saw_usage;
printf ("\037%c%s\n", defvarflag ? 'V' : 'F', input_buffer);
- if (comment)
- getc (infile); /* Skip past `*'. */
c = read_c_string_or_comment (infile, 1, comment, &saw_usage);
/* If this is a defun, find the arguments and print them. If