]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-07-30 Robert Millan <rmh@gnu.org>
authorRobert Millan <rmh@aybabtu.com>
Fri, 30 Jul 2010 09:27:02 +0000 (11:27 +0200)
committerRobert Millan <rmh@aybabtu.com>
Fri, 30 Jul 2010 09:27:02 +0000 (11:27 +0200)
* include/grub/emu/misc.h (grub_make_system_path_relative_to_its_root)
(xmalloc, xrealloc, xstrdup, xasprintf): Add
`warn_unused_result' attribute.
* include/grub/misc.h (grub_strdup, grub_strndup, grub_strlen)
(grub_xasprintf, grub_xvasprintf): Likewise.
* include/grub/emu/misc.h (xasprintf): Remove duplicate prototype.

ChangeLog
include/grub/emu/misc.h
include/grub/misc.h

index 94b6741d39ca2c12661dc46f4ab48926406b75a3..4026428a72cf3eace87a280b5d7e04192daa7a3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-30  Robert Millan  <rmh@gnu.org>
+
+       * include/grub/emu/misc.h (grub_make_system_path_relative_to_its_root)
+       (xmalloc, xrealloc, xstrdup, xasprintf): Add
+       `warn_unused_result' attribute.
+       * include/grub/misc.h (grub_strdup, grub_strndup, grub_strlen)
+       (grub_xasprintf, grub_xvasprintf): Likewise.
+       * include/grub/emu/misc.h (xasprintf): Remove duplicate prototype.
+
 2010-07-29  Robert Millan  <rmh@gnu.org>
 
        * util/grub-probe.c (PRINT_FS_LABEL): New enum value.
index f34cd4287a8e2959fd3020cff6b12301df6a2618..07257e511e60465936a8f58e8b9e25b3e9feb34f 100644 (file)
@@ -26,12 +26,12 @@ extern const char *program_name;
 void grub_init_all (void);
 void grub_fini_all (void);
 
-char *grub_make_system_path_relative_to_its_root (const char *path);
+char *grub_make_system_path_relative_to_its_root (const char *path) __attribute__ ((warn_unused_result));
 
-void * EXPORT_FUNC(xmalloc) (grub_size_t size);
-void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size);
-char * EXPORT_FUNC(xstrdup) (const char *str);
-char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
+void * EXPORT_FUNC(xmalloc) (grub_size_t size) __attribute__ ((warn_unused_result));
+void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
+char * EXPORT_FUNC(xstrdup) (const char *str) __attribute__ ((warn_unused_result));
+char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((warn_unused_result));
 
 void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...);
 void EXPORT_FUNC(grub_util_info) (const char *fmt, ...);
@@ -45,7 +45,6 @@ int EXPORT_FUNC(vasprintf) (char **buf, const char *fmt, va_list ap);
 int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...);
 #endif
 
-char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
 extern char * canonicalize_file_name (const char *path);
 
 #ifdef HAVE_DEVICE_MAPPER
index 9194ca8adad26fb62b733db6fde5cf4ea9d7c6d0..eab01b0fb25d38d4a7255b0c0f3a4f32d368c8cd 100644 (file)
@@ -231,10 +231,10 @@ grub_strtol (const char *str, char **end, int base)
     }
 }
 
-char *EXPORT_FUNC(grub_strdup) (const char *s);
-char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n);
+char *EXPORT_FUNC(grub_strdup) (const char *s) __attribute__ ((warn_unused_result));
+char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
 void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
-grub_size_t EXPORT_FUNC(grub_strlen) (const char *s);
+grub_size_t EXPORT_FUNC(grub_strlen) (const char *s) __attribute__ ((warn_unused_result));
 int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
@@ -261,8 +261,8 @@ int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
 int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt,
                                 va_list args);
 char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...)
-     __attribute__ ((format (printf, 1, 2)));
-char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args);
+     __attribute__ ((format (printf, 1, 2))) __attribute__ ((warn_unused_result));
+char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
 void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn));
 void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn));
 grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,