On Mon, Sep 5, 2016 at 9:22 AM, Jim Meyering <j...@meyering.net> wrote:
> On Mon, Sep 5, 2016 at 7:28 AM, Pino Toscano <ptosc...@redhat.com> wrote:
>> On Saturday, 3 September 2016 20:47:15 CEST Jim Meyering wrote:
> ...
>> Another thing: should some deprecation warning/note be added regarding
>> the progname module?
>
> I like the idea of adding a deprecation warning.
> If it could be completely replaced, I'd suggest to add the "Status:
> deprecated" attribute to its modules file, but we don't have a
> replacement for set_program_name, so there may still be legitimate
> uses. If a future change were to move set_program_name into its own
> new module, *then*, we could officially deprecate the progname module.
>
>> Is NEWS the proper place for them? Attached there
>> is a small documentation addendum.
>
> Good idea.
> While this is not officially an incompatible change, converting is
> invasive enough that this NEWS blurb belongs in that section.
>
> I've split a long sentence and merged that into your first commit.
> And pushed.
>
>>> I'm prepared to push the attached, but will wait for your ack.
>
> If you're interested, one more thing that may help avoid trouble would
> be to add a syntax-check rule to prohibit new uses of this module,
> including new inclusion of progname.h, new declarations of
> program_name or anything else you can think of that should no longer
> be done here in gnulib.

FYI, while adapting grep to use this module, I encountered a single
new error/warning. The attached patch fixes that:
From 7a10276e59a05f4176464e0fbadc3f743c8ed244 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@fb.com>
Date: Mon, 5 Sep 2016 21:40:57 -0700
Subject: [PATCH] getprogname.h: declare with _GL_ATTRIBUTE_PURE, when required

* lib/getprogname.h (getprogname) [HAVE_DECL_PROGRAM_INVOCATION_NAME]:
Declare with _GL_ATTRIBUTE_PURE, to avoid warning from gcc's
-Wsuggest-attribute=pure
---
 lib/getprogname.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/getprogname.h b/lib/getprogname.h
index b21e423..1887261 100644
--- a/lib/getprogname.h
+++ b/lib/getprogname.h
@@ -24,7 +24,11 @@ extern "C" {
 #endif

 #ifndef HAVE_GETPROGNAME
-extern const char *getprogname (void);
+extern const char *getprogname (void)
+# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+  _GL_ATTRIBUTE_PURE
+# endif
+  ;
 #endif

 #ifdef __cplusplus
-- 
2.8.0-rc2

Reply via email to