Subject: bug#50898: 28.0.50; with-suppressed-warnings doesn't always work

From: Stefan Monnier <[email-masked]>
Date: Tue, 30 Nov 2021 08:50:10 -0500

> This should now work again on the trunk.

Hmm...

    @@ -216,10 +216,11 @@ macroexp-macroexpand
             (let* ((fun (car form))
                    (obsolete (get fun 'byte-obsolete-info)))
               (macroexp-warn-and-return
    -           (macroexp--obsolete-warning
    -            fun obsolete
    -            (if (symbolp (symbol-function fun))
    -                "alias" "macro"))
    +           (and (byte-compile-warning-enabled-p 'obsolete fun)
    +                (macroexp--obsolete-warning
    +                 fun obsolete
    +                 (if (symbolp (symbol-function fun))
    +                     "alias" "macro")))
                new-form 'obsolete))
           new-form)))

I suspect this can fail if `bytecomp.el` is not yet loaded.

I think "the right way" to do that is to improve
`macroexp-warn-and-return` so that instead of only receiving `obsolete`
as `category` to decide if the warning is enabled or not, it should
additionally also receive `fun`.

        Stefan