From 7a10276e59a05f4176464e0fbadc3f743c8ed244 Mon Sep 17 00:00:00 2001 From: Jim Meyering 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