public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Avoid complaint warning on mingw
Date: Fri, 12 Apr 2024 12:02:04 -0400	[thread overview]
Message-ID: <6e68aa21-bbcf-4dc7-8688-da1c6ab311b8@simark.ca> (raw)
In-Reply-To: <20240409154617.1935108-1-tromey@adacore.com>

On 4/9/24 11:46 AM, Tom Tromey wrote:
> @@ -418,7 +429,7 @@ extern warning_hook_handler get_warning_hook_handler ();
>     instance of this class with the 'warn' function, and all warnings can be
>     emitted with a single call to 'emit'.  */
>  
> -struct deferred_warnings
> +struct deferred_warnings final : public warning_hook_handler_type
>  {
>    deferred_warnings ()
>      : m_can_style (gdb_stderr->can_emit_style_escape ())
> @@ -444,18 +455,11 @@ struct deferred_warnings
>       hook; see scoped_restore_warning_hook.  Note that no locking is
>       done, so users have to be careful to only install this into a
>       single thread at a time.  */
> -  void operator() (const char *format, va_list args)
> +  void warn (const char *format, va_list args) override
> +    ATTRIBUTE_PRINTF (2, 0)

The `warn (const char *format, ...)` method should probably defer to the
`warn (const char *format, va_list args)` method, they appear to do the
exact same thing.

Otherwise, LGTM:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2024-04-12 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 15:46 Tom Tromey
2024-04-12 16:02 ` Simon Marchi [this message]
2024-04-15 15:22   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e68aa21-bbcf-4dc7-8688-da1c6ab311b8@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).