unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH 1/2] lib: define DEPRECATED macro, document its use.
Date: Sat, 07 Mar 2015 18:52:48 +0200	[thread overview]
Message-ID: <87k2ysiwbj.fsf@nikula.org> (raw)
In-Reply-To: <1425746508-16224-1-git-send-email-david@tethera.net>

On Sat, 07 Mar 2015, David Bremner <david@tethera.net> wrote:
> This has been tested with gcc and clang.
> ---
>  devel/STYLE     | 10 ++++++++++
>  doc/doxygen.cfg |  2 +-
>  lib/notmuch.h   |  2 ++
>  3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/devel/STYLE b/devel/STYLE
> index 92de42c..fcd5e99 100644
> --- a/devel/STYLE
> +++ b/devel/STYLE
> @@ -93,3 +93,13 @@ libnotmuch conventions
>  
>  * Code which needs to be accessed from both the CLI and from
>    libnotmuch should be factored out into libutil (under util/).
> +
> +* Deprecated functions should be marked with the DEPRECATED macro
> +  which generates run time warnings with gcc and clang. In order not
> +  to confuse doxygen this should go at the beginning of the
> +  declaration like:
> +
> +  DEPRECATED(major,minor) notmuch_status_t notmuch_dwim(void *arg);
> +
> +  The @deprecated doxygen command can be used to generate markup in
> +  the API docs.
> diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg
> index 42b6339..c033f34 100644
> --- a/doc/doxygen.cfg
> +++ b/doc/doxygen.cfg
> @@ -74,7 +74,7 @@ STRICT_PROTO_MATCHING  = NO
>  GENERATE_TODOLIST      = NO
>  GENERATE_TESTLIST      = NO
>  GENERATE_BUGLIST       = NO
> -GENERATE_DEPRECATEDLIST= NO
> +GENERATE_DEPRECATEDLIST= YES
>  ENABLED_SECTIONS       =
>  MAX_INITIALIZER_LINES  = 30
>  SHOW_USED_FILES        = NO
> diff --git a/lib/notmuch.h b/lib/notmuch.h
> index 3e326bf..5fb51ba 100644
> --- a/lib/notmuch.h
> +++ b/lib/notmuch.h
> @@ -59,6 +59,8 @@ NOTMUCH_BEGIN_DECLS
>  #define LIBNOTMUCH_MINOR_VERSION	1
>  #define LIBNOTMUCH_MICRO_VERSION	0
>  
> +#define DEPRECATED(major,minor) \

Is that perhaps a too generic name for a macro? NOTMUCH_DEPRECATED?

Otherwise seems nice. Did not actually try it.

BR,
Jani.

> +    __attribute__ ((deprecated ("function deprecated as of libnotmuch " #major "." #minor)))
>  #endif /* __DOXYGEN__ */
>  
>  /**
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

      parent reply	other threads:[~2015-03-07 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07 16:41 [PATCH 1/2] lib: define DEPRECATED macro, document its use David Bremner
2015-03-07 16:41 ` [PATCH 2/2] lib: deprecate notmuch_query_search_{threads, messages} David Bremner
2015-03-07 16:52 ` Jani Nikula [this message]

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87k2ysiwbj.fsf@nikula.org \
    --to=jani@nikula.org \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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).