summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/debug.c3
-rw-r--r--lib/encodings.c12
-rw-r--r--lib/glcontainers.c4
-rw-r--r--lib/security.c2
-rw-r--r--lib/util.c2
-rw-r--r--libdb/db_lookup.c2
-rw-r--r--libdb/db_store.c2
-rw-r--r--src/whatis.c2
8 files changed, 16 insertions, 13 deletions
diff --git a/lib/debug.c b/lib/debug.c
index dd5ade86..53cefe9d 100644
--- a/lib/debug.c
+++ b/lib/debug.c
@@ -41,7 +41,8 @@ void init_debug (void)
debug_level = true;
}
-static void vdebug (const char *message, va_list args)
+static void ATTRIBUTE_FORMAT_PRINTF (1, 0) vdebug (const char *message,
+ va_list args)
{
if (debug_level)
vfprintf (stderr, message, args);
diff --git a/lib/encodings.c b/lib/encodings.c
index 8f69f7c9..b4660a92 100644
--- a/lib/encodings.c
+++ b/lib/encodings.c
@@ -408,7 +408,7 @@ const char *get_groff_preconv (void)
*
* The caller should free the returned string when it is finished with it.
*/
-char *get_page_encoding (const char *lang)
+char * _GL_ATTRIBUTE_MALLOC get_page_encoding (const char *lang)
{
const struct directory_entry *entry;
const char *dot;
@@ -723,7 +723,7 @@ const char *get_default_device (const char *charset_from_locale,
}
/* Is this a known *roff device name? */
-bool is_roff_device (const char *device)
+bool _GL_ATTRIBUTE_PURE is_roff_device (const char *device)
{
const struct device_entry *entry;
@@ -783,7 +783,7 @@ const char *get_roff_encoding (const char *device, const char *source_encoding)
/* Find the output encoding that this device will produce, or NULL if it
* will simply pass through the input encoding.
*/
-const char *get_output_encoding (const char *device)
+const char * _GL_ATTRIBUTE_PURE get_output_encoding (const char *device)
{
const struct device_entry *entry;
@@ -795,7 +795,8 @@ const char *get_output_encoding (const char *device)
}
/* Return the value of LESSCHARSET appropriate for this locale. */
-const char *get_less_charset (const char *charset_from_locale)
+const char * _GL_ATTRIBUTE_PURE get_less_charset (
+ const char *charset_from_locale)
{
const struct less_charset_entry *entry;
@@ -813,7 +814,8 @@ const char *get_less_charset (const char *charset_from_locale)
/* Return the value of JLESSCHARSET appropriate for this locale. May return
* NULL.
*/
-const char *get_jless_charset (const char *charset_from_locale)
+const char * _GL_ATTRIBUTE_PURE get_jless_charset (
+ const char *charset_from_locale)
{
const struct less_charset_entry *entry;
diff --git a/lib/glcontainers.c b/lib/glcontainers.c
index 732cbe42..cbd635cf 100644
--- a/lib/glcontainers.c
+++ b/lib/glcontainers.c
@@ -37,12 +37,12 @@
#include "glcontainers.h"
-bool string_equals (const void *s1, const void *s2)
+bool _GL_ATTRIBUTE_PURE string_equals (const void *s1, const void *s2)
{
return STREQ ((const char *) s1, (const char *) s2);
}
-size_t string_hash (const void *s)
+size_t _GL_ATTRIBUTE_PURE string_hash (const void *s)
{
return hash_pjw_bare (s, strlen ((const char *) s));
}
diff --git a/lib/security.c b/lib/security.c
index d869c642..55f2d85d 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -95,7 +95,7 @@ void init_security (void)
#endif /* MAN_OWNER */
}
-bool running_setuid (void)
+bool _GL_ATTRIBUTE_PURE running_setuid (void)
{
#ifdef MAN_OWNER
return ruid != euid;
diff --git a/lib/util.c b/lib/util.c
index 3f4b10f9..580cafd0 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -193,7 +193,7 @@ int remove_directory (const char *directory, int recurse)
/* Returns an allocated copy of s, with leading and trailing spaces
* removed.
*/
-char *trim_spaces (const char *s)
+char * _GL_ATTRIBUTE_MALLOC trim_spaces (const char *s)
{
int length;
while (*s == ' ')
diff --git a/libdb/db_lookup.c b/libdb/db_lookup.c
index a772ef87..9ff72d6c 100644
--- a/libdb/db_lookup.c
+++ b/libdb/db_lookup.c
@@ -97,7 +97,7 @@ static char *copy_if_set (const char *str)
return xstrdup (str);
}
-const char *dash_if_unset (const char *str)
+const char * _GL_ATTRIBUTE_CONST dash_if_unset (const char *str)
{
if (str)
return str;
diff --git a/libdb/db_store.c b/libdb/db_store.c
index cd68b665..508a41aa 100644
--- a/libdb/db_store.c
+++ b/libdb/db_store.c
@@ -49,7 +49,7 @@
* If promote_links is true, consider SO_MAN equivalent to ULT_MAN. This is
* appropriate when sorting candidate pages for display.
*/
-int compare_ids (char a, char b, int promote_links)
+int _GL_ATTRIBUTE_CONST compare_ids (char a, char b, int promote_links)
{
#ifdef FAVOUR_STRAYCATS
if (a == WHATIS_MAN && b == STRAY_CAT)
diff --git a/src/whatis.c b/src/whatis.c
index 8a89e80b..d2559169 100644
--- a/src/whatis.c
+++ b/src/whatis.c
@@ -636,7 +636,7 @@ static void parse_name (const char * const *pages, int num_pages,
}
/* return true on word match */
-static bool match (const char *page, const char *whatis)
+static bool _GL_ATTRIBUTE_PURE match (const char *page, const char *whatis)
{
size_t len = strlen (page);
const char *begin;