[PATCH] Clarify English strsignal() messages.
Florian Weimer
fweimer@redhat.com
Wed Sep 24 08:08:50 GMT 2025
* Zack Weinberg:
> Several of the strsignal() messages for the English locale are
> cryptic, inconsistent among a subgroup, or reflect what the signal
> was *originally* used for, rather than what it is used for today.
> Improve this somewhat.
>
> 95% of the practical value of this patch is in the change for the
> SIGFPE message, but if we’re gonna edit these messages at all,
> I think we should edit all of them at once. I'm working on a follow-up
> patch that tackles the strerror() messages and the manual's explanation
> of each error code, but this requires quite a bit more research.
>
> “Floating point exception” -> “Arithmetic exception”:
> Nowadays SIGFPE is almost always caused by *integer* divide by zero,
> since ISO C says the floating point environment at program startup
> has trapping disabled for all exceptions (C2011: Annex F subsection 8.3).
> When I was teaching CS I regularly got questions from students about
> why they got this error message when their program didn’t use any
> floating point at all. “Arithmetic exception” is the phrase used by
> musl libc, and also by the entire Sun clade for many years.
But is “exception” really the right term here? Language-level
exceptions don't result in signals.
> “Illegal instruction” -> “Invalid CPU instruction”
> I vaguely recall something in the GNU coding standards about
> preferring “invalid” to “illegal” unless something is actually
> against the law. Indicate what kind of instructions are meant.
It's not necessarily an invalid instruction. Several architectures have
an instruction that is defined to produce this signal.
Thanks,
Florian
More information about the Libc-alpha
mailing list