summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-10-07 15:00:24 -0500
committerDan McGee <dan@archlinux.org>2007-10-08 20:46:56 -0500
commit920b0d2049deb148efe89bfebda03d172b68c1f5 (patch)
tree885887ef8ac3ee6244fa8a2dfbc2fbc51df73145 /src
parentb1613c26518abb55ae5fc970dccfb7e3c97398d1 (diff)
downloadpacman-920b0d2049deb148efe89bfebda03d172b68c1f5.tar.xz
Update usage of gcc __attribute__ flags
Change the default visibility of libalpm functions to internal instead of hidden- this allows for slightly better optimization because it tells GCC that the function can never be called outside of the current module (see http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html). Also added some attributes to the pacman print functions so that they check the format strings being passed to them. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pacman/util.h b/src/pacman/util.h
index 73347fe8..f3171caf 100644
--- a/src/pacman/util.h
+++ b/src/pacman/util.h
@@ -49,9 +49,9 @@ char *strreplace(const char *str, const char *needle, const char *replace);
void list_display(const char *title, const alpm_list_t *list);
void display_targets(const alpm_list_t *syncpkgs);
int yesno(char *fmt, ...);
-int pm_printf(pmloglevel_t level, const char *format, ...);
-int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...);
-int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args);
+int pm_printf(pmloglevel_t level, const char *format, ...) __attribute__((format(printf,2,3)));
+int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) __attribute__((format(printf,3,4)));
+int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0)));
#endif /* _PM_UTIL_H */