]> git.sur5r.net Git - u-boot/blobdiff - include/common.h
RTC: Fix Makefile problem with COBJS-$(CONFIG_RTC_DS1307 || CONFIG_RTC_DS1338)
[u-boot] / include / common.h
index 10b997e9ec6189cb79e660cf1664ebdd7f2e345f..de3d595ed25c5ae63d6f1a5ba42bcabcc96bd903 100644 (file)
@@ -119,11 +119,13 @@ typedef volatile unsigned char    vu_char;
 #define debugX(level,fmt,args...)
 #endif /* DEBUG */
 
+#ifndef BUG
 #define BUG() do { \
        printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
        panic("BUG!"); \
 } while (0)
 #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+#endif /* BUG */
 
 typedef void (interrupt_handler_t)(void *);
 
@@ -222,7 +224,6 @@ void        board_init_r  (gd_t *, ulong) __attribute__ ((noreturn));
 int    checkboard    (void);
 int    checkflash    (void);
 int    checkdram     (void);
-char * strmhz(char *buf, long hz);
 int    last_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
@@ -607,10 +608,15 @@ ulong     simple_strtoul(const char *cp,char **endp,unsigned int base);
 unsigned long long     simple_strtoull(const char *cp,char **endp,unsigned int base);
 #endif
 long   simple_strtol(const char *cp,char **endp,unsigned int base);
-void   panic(const char *fmt, ...);
-int    sprintf(char * buf, const char *fmt, ...);
+void   panic(const char *fmt, ...)
+               __attribute__ ((format (__printf__, 1, 2)));
+int    sprintf(char * buf, const char *fmt, ...)
+               __attribute__ ((format (__printf__, 2, 3)));
 int    vsprintf(char *buf, const char *fmt, va_list args);
 
+/* lib_generic/strmhz.c */
+char * strmhz(char *buf, long hz);
+
 /* lib_generic/crc32.c */
 uint32_t crc32 (uint32_t, const unsigned char *, uint);
 uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
@@ -630,7 +636,8 @@ int disable_ctrlc (int);    /* 1 to disable, 0 to enable Control-C detect */
  */
 
 /* serial stuff */
-void   serial_printf (const char *fmt, ...);
+void   serial_printf (const char *fmt, ...)
+               __attribute__ ((format (__printf__, 1, 2)));
 
 /* stdin */
 int    getc(void);
@@ -639,7 +646,8 @@ int tstc(void);
 /* stdout */
 void   putc(const char c);
 void   puts(const char *s);
-void   printf(const char *fmt, ...);
+void   printf(const char *fmt, ...)
+               __attribute__ ((format (__printf__, 1, 2)));
 void   vprintf(const char *fmt, va_list args);
 
 /* stderr */
@@ -656,7 +664,8 @@ void        vprintf(const char *fmt, va_list args);
 #define stderr         2
 #define MAX_FILES      3
 
-void   fprintf(int file, const char *fmt, ...);
+void   fprintf(int file, const char *fmt, ...)
+               __attribute__ ((format (__printf__, 2, 3)));
 void   fputs(int file, const char *s);
 void   fputc(int file, const char c);
 int    ftstc(int file);