[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix error messages containing format strings
From: |
Michael Käppler |
Subject: |
[PATCH] Fix error messages containing format strings |
Date: |
Tue, 23 Apr 2024 10:54:29 +0200 |
User-agent: |
Mozilla Thunderbird |
Hi all,
I recently posted a bug report together with a patch to bug-guile, but
received no response at all:
https://lists.gnu.org/archive/html/bug-guile/2024-04/msg00000.html
I don't know what the preferred way of reporting bugs and proposing
patches for Guile is, so
I'm retrying here on guile-devel.
--------------------------------------------------
I recently ran into the issue that some error messages in Guile are not
formatted properly.
As a simple reproducer, fire up a REPL and do
,option on-error 'foo
Which will yield
"While executing meta-command:
Bad on-error value ~a; expected one of ~a foo (debug backtrace report pass)"
The reason is that format strings occurring in the message are
escaped, see `module/ice-9/boot-9.scm` and
`module/language/tree-il/primitives.scm`.
So a call of
`(error "Wrong argument: ~a" 42)`
is rendered as
"Wrong argument: ~a 42"
Some callers did not take this behavior into account.
Patch attached.
Michael
0001-Fix-error-messages-containing-format-strings.patch
Description: Text document
- [PATCH] Fix error messages containing format strings,
Michael Käppler <=