]> Savannah Git Hosting - gnulib.git/commitdiff
getprogname.h: declare with _GL_ATTRIBUTE_PURE, when required
authorJim Meyering <meyering@fb.com>
Tue, 6 Sep 2016 04:40:57 +0000 (21:40 -0700)
committerJim Meyering <meyering@fb.com>
Tue, 6 Sep 2016 04:41:06 +0000 (21:41 -0700)
* 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

index b21e4232b5a7a7d4e0f3e8ce704a041792f959a4..1887261d2fd720182931702d4e9c4d54c9364c36 100644 (file)
@@ -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