Changeset 2057

Show
Ignore:
Timestamp:
01/18/2008 11:05:47 AM (7 months ago)
Author:
glen
Message:

- give compiler hint that log_trace is printf format args

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/log.h

    r1827 r2057  
    2020#endif 
    2121 
     22// TODO: perhaps make portable (detect if cc supports) 
     23#define __ATTRIBUTE_PRINTF_FORMAT(fmt, arg) __attribute__ ((__format__ (__printf__, fmt, arg))) 
     24 
    2225#define ERROR(fmt, ...) \ 
    2326        log_trace("%s.%d: (error) "fmt, REMOVE_PATH(__FILE__), __LINE__, __VA_ARGS__) 
     
    3235                abort();\ 
    3336        } while(0) 
    34 LI_API int log_trace(const char *fmt, ...); 
     37LI_API int log_trace(const char *fmt, ...) __ATTRIBUTE_PRINTF_FORMAT(1, 2); 
    3538#endif