[m-rev.] for review: disable_warning [unknown_format_calls]

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Sep 12 03:38:45 AEST 2022


2022-09-07 20:05 GMT+10:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:
> Ah. In that case, I propose that after the identification of the pred/func,
> the second argument should either have the format "format_string_poly_types(N, M)",
> where N & M are the argument numbers of the format string and the poly types
> respectively (for the usual use case), or a list of such terms (for the use case
> you just brought up). Having the format string and the poly types specified
> separately would work, or at least wouldn't work well, in the latter use case.

Attached is the proposed diff to the reference manual. For review by anyone.

You will notice that I changed both the name of the pragma, and the function symbol
above, slightly.

With the description of what checks the pragma calls for, the added text
takes up three and a half pages in the PDF version of the manual.

I am not entirely happy with the way the indentation comes out around
some of the examples and around the table, but I don't know what would be better.

There are two intentional omissions in this diff.

- I do not say that the new pragma cannot apply to a typeclass method.
  The reason for the omission is that this is much more a property
  of typeclass definitions than of this pragma (other kinds of decl_pragmas
  cannot appear in typeclass definitions either).

- I do not mention that the new pragma suppresses unknown format warnings
  for format calls that use the specified arguments for the format string and
  the values list. The reason for this omission is that this pragma effectively
  transfers the responsibility to get the format string/values list correspondence right
  from the pragma that the pragma names to its callers, and that therefore
  any such warnings would be generated at those call sites instead.
  Therefore the absence of such warnings inside this predicate should not
  be surprising; in fact, it is their *presence* that would be surprising.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.pfc
Type: application/octet-stream
Size: 10244 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20220912/b1c3b1da/attachment-0001.obj>


More information about the reviews mailing list