Subject: bug#71379: 29.3; Elisp compiler: warnings for formats given insufficiently many arguments

From: Andrea Corallo <[email-masked]>
Date: Fri, 07 Jun 2024 09:55:08 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Stefan Kangas <[email-masked]>
>> Date: Fri, 7 Jun 2024 01:22:49 +0200
>> Cc: [email-masked], philippe schnoebelen <[email-masked]>
>> 
>> Mattias Engdegård <[email-masked]> writes:
>> 
>> > 6 juni 2024 kl. 06.38 skrev Eli Zaretskii <[email-masked]>:
>> >
>> >> On second thought, this is still fine to go in now, but I wonder
>> >> whether we should move these to the places where the corresponding
>> >> functions are defined, and leave in bytecomp.c only those which are
>> >> primitives defined in C?  That would mean 'warn' and 'user-error'
>> >> should be moved to their respective Lisp files.
>> >
>> > Indeed it's a question I always ask myself every so often, and
>> > sometimes we distribute properties to definitions.
>> > However, in this case it seems better to keep them in one place:
>> > it's only a small handful of functions, and this way the
>> > properties are kept local to the byte-compiler.
>> 
>> No strong opinion, but I think this cuts both ways: keeping it local to
>> the definition of the functions themselves makes it clear to anyone
>> looking there for inspiration how to add such warnings to their own
>> `format` functions.
>
> Indeed.  In addition, some functions marked with this property already
> do that in their own files.  Which was why I asked that question in
> the first place.

Agreed.  Maybe in the future even worth having a declare for it?  We
have them already for things like ex 'important-return-value'.

  Andrea