chore: silence build warnings on non-macOS toolchains
- ekp_hyphen.c: check fgets return when skipping the dictionary encoding line (gcc -Wunused-result via glibc fortify); behavior unchanged — an empty file already fell through to EOF in the loops - ekp-utils.el: declare-function for font-info, which does not exist in non-window-system builds (emacs-nox); call site is runtime-guarded by display-multi-font-p. Keeps byte-compile-error-on-warn green. Verified: clean gcc build + 36/36 ERT + 300-case fuzz on Ubuntu 24.04 (Emacs 29.3, arm64), clean clang build + 36/36 ERT on macOS (30.2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
112b3a0e52
commit
9afe491e1a
@ -41,6 +41,10 @@ information is available (batch mode, tty frames)."
|
||||
(let ((family (face-attribute 'default :family)))
|
||||
(if (stringp family) family (format "%s" family)))))
|
||||
|
||||
;; GUI-only C function; absent in non-window-system builds (emacs-nox).
|
||||
;; Call sites are guarded by `display-multi-font-p'.
|
||||
(declare-function font-info "font.c" (name &optional frame))
|
||||
|
||||
(defun ekp-font-monospace-p (font-family)
|
||||
"Return non-nil if FONT-FAMILY appears to be monospace.
|
||||
Returns nil (unknown) when font information is unavailable."
|
||||
|
||||
@ -99,7 +99,9 @@ ekp_hyphenator_t *ekp_hyphen_create(const char *dict_path)
|
||||
char line[256];
|
||||
size_t count = 0;
|
||||
|
||||
fgets(line, sizeof(line), fp); /* skip encoding line */
|
||||
if (!fgets(line, sizeof(line), fp)) {
|
||||
/* empty file: no encoding line to skip; count loop sees EOF */
|
||||
}
|
||||
|
||||
while (fgets(line, sizeof(line), fp)) {
|
||||
size_t len = strlen(line);
|
||||
@ -128,7 +130,9 @@ ekp_hyphenator_t *ekp_hyphen_create(const char *dict_path)
|
||||
|
||||
/* Second pass: parse patterns */
|
||||
rewind(fp);
|
||||
fgets(line, sizeof(line), fp); /* skip encoding line */
|
||||
if (!fgets(line, sizeof(line), fp)) {
|
||||
/* empty file: no encoding line to skip; parse loop sees EOF */
|
||||
}
|
||||
|
||||
size_t idx = 0;
|
||||
while (fgets(line, sizeof(line), fp)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user