From 0c06669db6c4e363155dbd283cdff6989c14d76c Mon Sep 17 00:00:00 2001 From: szaka Date: Thu, 25 Oct 2007 20:09:29 +0000 Subject: [PATCH] struct ntfs_logging: workaround for broken gcc format attribute handling --- libntfs-3g/logging.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/logging.c b/libntfs-3g/logging.c index 228e90e0..6d85bcf2 100644 --- a/libntfs-3g/logging.c +++ b/libntfs-3g/logging.c @@ -58,6 +58,13 @@ static const char *col_red = "\e[01;31m"; static const char *col_redinv = "\e[01;07;31m"; static const char *col_end = "\e[0m"; +/* gcc 3.3.3 crashes with internal compiler error. 4.x seems to be ok. */ +#if __GNUC__ <= 3 +# define BROKEN_GCC_FORMAT_ATTRIBUTE +#else +# define BROKEN_GCC_FORMAT_ATTRIBUTE __attribute__((format(printf, 6, 0))) +#endif + /** * struct ntfs_logging - Control info for the logging system * @levels: Bitfield of logging levels @@ -67,7 +74,7 @@ static const char *col_end = "\e[0m"; struct ntfs_logging { u32 levels; u32 flags; - ntfs_log_handler *handler; + ntfs_log_handler *handler BROKEN_GCC_FORMAT_ATTRIBUTE; }; /**