1
0
Fork 0
forked from len0rd/rockbox

Let GCC check arguments of some more printf-style functions, also for plugins and codecs.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12815 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-03-17 09:02:53 +00:00
parent 1329d7d3fd
commit 79c8a8cbbe
20 changed files with 55 additions and 49 deletions

View file

@ -166,7 +166,7 @@ struct codec_api {
/* Configure different codec buffer parameters. */ /* Configure different codec buffer parameters. */
void (*configure)(int setting, intptr_t value); void (*configure)(int setting, intptr_t value);
void (*splash)(int ticks, const unsigned char *fmt, ...); void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
/* file */ /* file */
int (*PREFIX(open))(const char* pathname, int flags); int (*PREFIX(open))(const char* pathname, int flags);
@ -180,7 +180,7 @@ struct codec_api {
int (*PREFIX(ftruncate))(int fd, off_t length); int (*PREFIX(ftruncate))(int fd, off_t length);
int (*PREFIX(fsync))(int fd); int (*PREFIX(fsync))(int fd);
int (*fdprintf)(int fd, const char *fmt, ...); int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
int (*read_line)(int fd, char* buffer, int buffer_size); int (*read_line)(int fd, char* buffer, int buffer_size);
bool (*settings_parseline)(char* line, char** name, char** value); bool (*settings_parseline)(char* line, char** name, char** value);
#ifndef SIMULATOR #ifndef SIMULATOR
@ -218,7 +218,8 @@ struct codec_api {
#endif #endif
/* strings and memory */ /* strings and memory */
int (*snprintf)(char *buf, size_t size, const char *fmt, ...); int (*snprintf)(char *buf, size_t size, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4);
char* (*strcpy)(char *dst, const char *src); char* (*strcpy)(char *dst, const char *src);
char* (*strncpy)(char *dst, const char *src, size_t length); char* (*strncpy)(char *dst, const char *src, size_t length);
size_t (*strlen)(const char *str); size_t (*strlen)(const char *str);
@ -278,10 +279,10 @@ struct codec_api {
bool signd); bool signd);
#if defined(DEBUG) || defined(SIMULATOR) #if defined(DEBUG) || defined(SIMULATOR)
void (*debugf)(const char *fmt, ...); void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
#endif #endif
#ifdef ROCKBOX_HAS_LOGF #ifdef ROCKBOX_HAS_LOGF
void (*logf)(const char *fmt, ...); void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
#endif #endif
struct user_settings* global_settings; struct user_settings* global_settings;
bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first);

View file

@ -19,6 +19,7 @@
#ifndef _GUI_SPLASH_H_ #ifndef _GUI_SPLASH_H_
#define _GUI_SPLASH_H_ #define _GUI_SPLASH_H_
#include <_ansi.h>
#include "screen_access.h" #include "screen_access.h"
/* /*
@ -28,13 +29,14 @@
* - fmt : what to say *printf style * - fmt : what to say *printf style
*/ */
extern void gui_splash(struct screen * screen, int ticks, extern void gui_splash(struct screen * screen, int ticks,
const char *fmt, ...); const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4);
/* /*
* Puts a splash message centered on all the screens for a given period * Puts a splash message centered on all the screens for a given period
* - ticks : how long the splash is displayed (in rb ticks) * - ticks : how long the splash is displayed (in rb ticks)
* - fmt : what to say *printf style * - fmt : what to say *printf style
*/ */
extern void gui_syncsplash(int ticks, const unsigned char *fmt, ...); extern void gui_syncsplash(int ticks, const char *fmt, ...)
ATTRIBUTE_PRINTF(2, 3);
#endif /* _GUI_ICON_H_ */ #endif /* _GUI_ICON_H_ */

View file

@ -205,7 +205,7 @@ struct plugin_api {
void (*backlight_on)(void); void (*backlight_on)(void);
void (*backlight_off)(void); void (*backlight_off)(void);
void (*backlight_set_timeout)(int index); void (*backlight_set_timeout)(int index);
void (*splash)(int ticks, const unsigned char *fmt, ...); void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
/* remote lcd */ /* remote lcd */
@ -296,7 +296,7 @@ struct plugin_api {
int (*PREFIX(rename))(const char* path, const char* newname); int (*PREFIX(rename))(const char* path, const char* newname);
int (*PREFIX(ftruncate))(int fd, off_t length); int (*PREFIX(ftruncate))(int fd, off_t length);
off_t (*PREFIX(filesize))(int fd); off_t (*PREFIX(filesize))(int fd);
int (*fdprintf)(int fd, const char *fmt, ...); int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
int (*read_line)(int fd, char* buffer, int buffer_size); int (*read_line)(int fd, char* buffer, int buffer_size);
bool (*settings_parseline)(char* line, char** name, char** value); bool (*settings_parseline)(char* line, char** name, char** value);
#ifndef SIMULATOR #ifndef SIMULATOR
@ -369,7 +369,8 @@ struct plugin_api {
#endif #endif
/* strings and memory */ /* strings and memory */
int (*snprintf)(char *buf, size_t size, const char *fmt, ...); int (*snprintf)(char *buf, size_t size, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4);
int (*vsnprintf)(char *buf, int size, const char *fmt, va_list ap); int (*vsnprintf)(char *buf, int size, const char *fmt, va_list ap);
char* (*strcpy)(char *dst, const char *src); char* (*strcpy)(char *dst, const char *src);
char* (*strncpy)(char *dst, const char *src, size_t length); char* (*strncpy)(char *dst, const char *src, size_t length);
@ -519,10 +520,10 @@ struct plugin_api {
void* (*plugin_get_audio_buffer)(int* buffer_size); void* (*plugin_get_audio_buffer)(int* buffer_size);
void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
#if defined(DEBUG) || defined(SIMULATOR) #if defined(DEBUG) || defined(SIMULATOR)
void (*debugf)(const char *fmt, ...); void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
#endif #endif
#ifdef ROCKBOX_HAS_LOGF #ifdef ROCKBOX_HAS_LOGF
void (*logf)(const char *fmt, ...); void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
#endif #endif
struct user_settings* global_settings; struct user_settings* global_settings;
bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first);

View file

@ -459,7 +459,7 @@ int main(void)
#endif #endif
"\n" "\n"
,BATTERY_LOG,rb->global_settings->battery_capacity, ,BATTERY_LOG,rb->global_settings->battery_capacity,
BUF_SIZE / sizeof(struct batt_info)); BUF_SIZE / (unsigned)sizeof(struct batt_info));
rb->close(fd); rb->close(fd);
} }
else else

View file

@ -1918,25 +1918,25 @@ void deh_procFrame(DEHFILE *fpin, int fpout, char *line)
} }
if (!strcasecmp(key,deh_state[0])) // Sprite number if (!strcasecmp(key,deh_state[0])) // Sprite number
{ {
if (fpout) fdprintf(fpout," - sprite = %d\n",value); if (fpout) fdprintf(fpout," - sprite = %ld\n",(long)value);
states[indexnum].sprite = (spritenum_t)value; states[indexnum].sprite = (spritenum_t)value;
} }
else else
if (!strcasecmp(key,deh_state[1])) // Sprite subnumber if (!strcasecmp(key,deh_state[1])) // Sprite subnumber
{ {
if (fpout) fdprintf(fpout," - frame = %d\n",value); if (fpout) fdprintf(fpout," - frame = %ld\n",(long)value);
states[indexnum].frame = (long)value; // long states[indexnum].frame = (long)value; // long
} }
else else
if (!strcasecmp(key,deh_state[2])) // Duration if (!strcasecmp(key,deh_state[2])) // Duration
{ {
if (fpout) fdprintf(fpout," - tics = %d\n",value); if (fpout) fdprintf(fpout," - tics = %ld\n",(long)value);
states[indexnum].tics = (long)value; // long states[indexnum].tics = (long)value; // long
} }
else else
if (!strcasecmp(key,deh_state[3])) // Next frame if (!strcasecmp(key,deh_state[3])) // Next frame
{ {
if (fpout) fdprintf(fpout," - nextstate = %d\n",value); if (fpout) fdprintf(fpout," - nextstate = %ld\n",(long)value);
states[indexnum].nextstate = (statenum_t)value; states[indexnum].nextstate = (statenum_t)value;
} }
else else
@ -1948,13 +1948,13 @@ void deh_procFrame(DEHFILE *fpin, int fpout, char *line)
else else
if (!strcasecmp(key,deh_state[5])) // Unknown 1 if (!strcasecmp(key,deh_state[5])) // Unknown 1
{ {
if (fpout) fdprintf(fpout," - misc1 = %d\n",value); if (fpout) fdprintf(fpout," - misc1 = %ld\n",(long)value);
states[indexnum].misc1 = (long)value; // long states[indexnum].misc1 = (long)value; // long
} }
else else
if (!strcasecmp(key,deh_state[6])) // Unknown 2 if (!strcasecmp(key,deh_state[6])) // Unknown 2
{ {
if (fpout) fdprintf(fpout," - misc2 = %d\n",value); if (fpout) fdprintf(fpout," - misc2 = %ld\n",(long)value);
states[indexnum].misc2 = (long)value; // long states[indexnum].misc2 = (long)value; // long
} }
else else
@ -2017,8 +2017,8 @@ void deh_procPointer(DEHFILE *fpin, int fpout, char *line) // done
if (!strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block) if (!strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block)
{ {
states[indexnum].action = deh_codeptr[value]; states[indexnum].action = deh_codeptr[value];
if (fpout) fdprintf(fpout," - applied from codeptr[%d] to states[%d]\n", if (fpout) fdprintf(fpout," - applied from codeptr[%ld] to states[%d]\n",
value,indexnum); (long)value,indexnum);
// Write BEX-oriented line to match: // Write BEX-oriented line to match:
for (i=0;i<NUMSTATES;i++) for (i=0;i<NUMSTATES;i++)
{ {

View file

@ -418,10 +418,10 @@ int flash_rockbox(const char *filename, int section)
if (section == SECT_ROMIMAGE) if (section == SECT_ROMIMAGE)
{ {
uint32_t *p32 = (uint32_t *)audiobuf; uint32_t *p32 = (uint32_t *)audiobuf;
if (pos+sizeof(struct flash_header) != *p32) if (pos+sizeof(struct flash_header) != *p32)
{ {
rb->snprintf(buf, sizeof(buf), "Incorrect relocation: 0x%08x/0x%08x", rb->snprintf(buf, sizeof(buf), "Incorrect relocation: 0x%08lx/0x%08lx",
*p32, pos+sizeof(struct flash_header)); *p32, pos+sizeof(struct flash_header));
rb->splash(HZ*10, buf); rb->splash(HZ*10, buf);
return -1; return -1;

View file

@ -2565,7 +2565,7 @@ struct t_disp* get_image(struct jpeg* p_jpg, int ds)
if(!running_slideshow) if(!running_slideshow)
{ {
rb->snprintf(print, sizeof(print), " %d.%02d sec ", time/HZ, time%HZ); rb->snprintf(print, sizeof(print), " %ld.%02ld sec ", time/HZ, time%HZ);
rb->lcd_getstringsize(print, &w, &h); /* centered in progress bar */ rb->lcd_getstringsize(print, &w, &h); /* centered in progress bar */
rb->lcd_putsxy((LCD_WIDTH - w)/2, LCD_HEIGHT - h, print); rb->lcd_putsxy((LCD_WIDTH - w)/2, LCD_HEIGHT - h, print);
rb->lcd_update(); rb->lcd_update();

View file

@ -124,7 +124,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig)
/* Scan our config file and load the right patches as needed */ /* Scan our config file and load the right patches as needed */
int c = 0; int c = 0;
rb->snprintf(name, 40, ""); name[0] = '\0';
printf("\nLoading instruments"); printf("\nLoading instruments");
for(a=0; a<128; a++) for(a=0; a<128; a++)
{ {

View file

@ -2466,10 +2466,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
} }
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->snprintf(stg, 30, " Conversion: %d.%02ds ", tim/100, tim%100); rb->snprintf(stg, 30, " Conversion: %ld.%02lds ", tim/100, tim%100);
rb->lcd_putsxy(0, 30, stg); rb->lcd_putsxy(0, 30, stg);
tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */ tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */
rb->snprintf(stg, 30, " WAV-Length: %d.%02ds ", tim/100, tim%100); rb->snprintf(stg, 30, " WAV-Length: %ld.%02lds ", tim/100, tim%100);
rb->lcd_putsxy(0, 20, stg); rb->lcd_putsxy(0, 20, stg);
rb->lcd_update(); rb->lcd_update();
rb->sleep(5*HZ); rb->sleep(5*HZ);

View file

@ -693,7 +693,7 @@ void DoUserDialog(char* filename)
crc = CheckBootloader(); crc = CheckBootloader();
if (crc) /* outdated version found */ if (crc) /* outdated version found */
{ {
rb->snprintf(buf, sizeof(buf), "(check=0x%08x)", crc); rb->snprintf(buf, sizeof(buf), "(check=0x%08lx)", crc);
rb->lcd_puts(0, 0, buf); rb->lcd_puts(0, 0, buf);
rb->lcd_puts(0, 1, "Hint: You're not "); rb->lcd_puts(0, 1, "Hint: You're not ");
rb->lcd_puts(0, 2, "using the latest "); rb->lcd_puts(0, 2, "using the latest ");

View file

@ -167,7 +167,7 @@ static void build_slot_path(char *buf, size_t bufsiz, size_t slot_id) {
munge_name(name_buf, strlen(name_buf)); munge_name(name_buf, strlen(name_buf));
/* glom the whole mess together */ /* glom the whole mess together */
snprintf(buf, bufsiz, "%s/%s-%d.rbs", STATE_DIR, name_buf, slot_id + 1); snprintf(buf, bufsiz, "%s/%s-%ld.rbs", STATE_DIR, name_buf, slot_id + 1);
} }
/* /*
@ -263,17 +263,17 @@ static void slot_info(char *info_buf, size_t info_bufsiz, size_t slot_id) {
if (read(fd, buf, 20) > 0) if (read(fd, buf, 20) > 0)
{ {
buf[20] = '\0'; buf[20] = '\0';
snprintf(info_buf, info_bufsiz, "%d. %s", slot_id + 1, buf); snprintf(info_buf, info_bufsiz, "%ld. %s", slot_id + 1, buf);
} }
else else
snprintf(info_buf, info_bufsiz, "%d. ERROR", slot_id + 1); snprintf(info_buf, info_bufsiz, "%ld. ERROR", slot_id + 1);
close(fd); close(fd);
} }
else else
{ {
/* if we couldn't open the file, then the slot is empty */ /* if we couldn't open the file, then the slot is empty */
snprintf(info_buf, info_bufsiz, "%d. %s", slot_id + 1, "<Empty>"); snprintf(info_buf, info_bufsiz, "%ld. %s", slot_id + 1, "<Empty>");
} }
} }

View file

@ -2958,7 +2958,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
} }
else else
{ {
rb->splash( 1*HZ, "Image loaded (%s)", parameter ); rb->splash( 1*HZ, "Image loaded (%s)", (char *)parameter );
restore_screen(); restore_screen();
rb->strcpy( filename, parameter ); rb->strcpy( filename, parameter );
} }

View file

@ -168,7 +168,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
if(p) if(p)
*p = 0; *p = 0;
rb->snprintf(resultfile, MAX_PATH, "%s/search_result.m3u", path, p+1); rb->snprintf(resultfile, MAX_PATH, "%s/search_result.m3u", path);
ok = search_init(parameter); ok = search_init(parameter);
if (!ok) { if (!ok) {
return PLUGIN_ERROR; return PLUGIN_ERROR;

View file

@ -207,7 +207,7 @@ static bool test_speed(void)
goto error; goto error;
} }
time = *rb->current_tick - time; time = *rb->current_tick - time;
rb->snprintf(text_buf, sizeof text_buf, "Create: %d KByte/s", rb->snprintf(text_buf, sizeof text_buf, "Create: %ld KByte/s",
(25 * buf_len / time) >> 8); (25 * buf_len / time) >> 8);
log_lcd(text_buf, true); log_lcd(text_buf, true);
rb->close(fd); rb->close(fd);
@ -226,7 +226,7 @@ static bool test_speed(void)
goto error; goto error;
} }
time = *rb->current_tick - time; time = *rb->current_tick - time;
rb->snprintf(text_buf, sizeof text_buf, "Write A: %d KByte/s", rb->snprintf(text_buf, sizeof text_buf, "Write A: %ld KByte/s",
(25 * buf_len / time) >> 8); (25 * buf_len / time) >> 8);
log_lcd(text_buf, true); log_lcd(text_buf, true);
rb->close(fd); rb->close(fd);
@ -245,7 +245,7 @@ static bool test_speed(void)
goto error; goto error;
} }
time = *rb->current_tick - time; time = *rb->current_tick - time;
rb->snprintf(text_buf, sizeof text_buf, "Write U: %d KByte/s", rb->snprintf(text_buf, sizeof text_buf, "Write U: %ld KByte/s",
(25 * buf_len / time) >> 8); (25 * buf_len / time) >> 8);
log_lcd(text_buf, true); log_lcd(text_buf, true);
rb->close(fd); rb->close(fd);
@ -264,7 +264,7 @@ static bool test_speed(void)
goto error; goto error;
} }
time = *rb->current_tick - time; time = *rb->current_tick - time;
rb->snprintf(text_buf, sizeof text_buf, "Read A: %d KByte/s", rb->snprintf(text_buf, sizeof text_buf, "Read A: %ld KByte/s",
(25 * buf_len / time) >> 8); (25 * buf_len / time) >> 8);
log_lcd(text_buf, true); log_lcd(text_buf, true);
rb->close(fd); rb->close(fd);
@ -283,7 +283,7 @@ static bool test_speed(void)
goto error; goto error;
} }
time = *rb->current_tick - time; time = *rb->current_tick - time;
rb->snprintf(text_buf, sizeof text_buf, "Read U: %d KByte/s", rb->snprintf(text_buf, sizeof text_buf, "Read U: %ld KByte/s",
(25 * buf_len / time) >> 8); (25 * buf_len / time) >> 8);
log_lcd(text_buf, true); log_lcd(text_buf, true);
rb->close(fd); rb->close(fd);

View file

@ -123,7 +123,7 @@ char *list_get_name_cb(int selected_item,void* data,char* buf)
{ {
char t = b[MAX_PATH-10]; char t = b[MAX_PATH-10];
b[MAX_PATH-10] = '\0'; b[MAX_PATH-10] = '\0';
rb->snprintf(buf,MAX_PATH,"%s ...\0",b); rb->snprintf(buf,MAX_PATH,"%s ...",b);
b[MAX_PATH-10] = t; b[MAX_PATH-10] = t;
} }
else rb->strcpy(buf,b); else rb->strcpy(buf,b);

View file

@ -962,9 +962,9 @@ int main(char* filename)
rb->lcd_puts(0, 2, gPrint); rb->lcd_puts(0, 2, gPrint);
rb->snprintf(gPrint, sizeof(gPrint), "%d MinVideo bytes", gStats.minVideoAvail); rb->snprintf(gPrint, sizeof(gPrint), "%d MinVideo bytes", gStats.minVideoAvail);
rb->lcd_puts(0, 3, gPrint); rb->lcd_puts(0, 3, gPrint);
rb->snprintf(gPrint, sizeof(gPrint), "MinSpinup %d.%02d", gStats.minSpinup/HZ, gStats.minSpinup%HZ); rb->snprintf(gPrint, sizeof(gPrint), "MinSpinup %ld.%02ld", gStats.minSpinup/HZ, gStats.minSpinup%HZ);
rb->lcd_puts(0, 4, gPrint); rb->lcd_puts(0, 4, gPrint);
rb->snprintf(gPrint, sizeof(gPrint), "MaxSpinup %d.%02d", gStats.maxSpinup/HZ, gStats.maxSpinup%HZ); rb->snprintf(gPrint, sizeof(gPrint), "MaxSpinup %ld.%02ld", gStats.maxSpinup/HZ, gStats.maxSpinup%HZ);
rb->lcd_puts(0, 5, gPrint); rb->lcd_puts(0, 5, gPrint);
rb->snprintf(gPrint, sizeof(gPrint), "LowWater: %d", gBuf.low_water); rb->snprintf(gPrint, sizeof(gPrint), "LowWater: %d", gBuf.low_water);
rb->lcd_puts(0, 6, gPrint); rb->lcd_puts(0, 6, gPrint);

View file

@ -80,7 +80,7 @@ static void wvupdate (int32_t start_tick,
compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 + compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 +
(bytes_read/2)) / bytes_read); (bytes_read/2)) / bytes_read);
rb->snprintf(buf, 32, "elapsed time: %d secs", (elapsed_ticks + (HZ/2)) / HZ); rb->snprintf(buf, 32, "elapsed time: %ld secs", (elapsed_ticks + (HZ/2)) / HZ);
rb->lcd_puts(0, 2, (unsigned char *)buf); rb->lcd_puts(0, 2, (unsigned char *)buf);
rb->snprintf(buf, 32, "progress: %d%%", progress); rb->snprintf(buf, 32, "progress: %d%%", progress);

View file

@ -19,9 +19,12 @@
#ifndef DEBUG_H #ifndef DEBUG_H
#define DEBUG_H #define DEBUG_H
#include <_ansi.h>
extern void debug_init(void); extern void debug_init(void);
extern void debugf(const char* fmt,...); extern void debugf(const char* fmt,...) ATTRIBUTE_PRINTF(1, 2);
extern void ldebugf(const char* file, int line, const char *fmt, ...); extern void ldebugf(const char* file, int line, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4);
#ifdef __GNUC__ #ifdef __GNUC__

View file

@ -34,7 +34,7 @@ extern bool logfwrap;
#endif /* __PCTOOL__ */ #endif /* __PCTOOL__ */
#define logf _logf #define logf _logf
void _logf(const char *format, ...); void _logf(const char *format, ...) ATTRIBUTE_PRINTF(1, 2);
#else /* !ROCKBOX_HAS_LOGF */ #else /* !ROCKBOX_HAS_LOGF */
/* built without logf() support enabled */ /* built without logf() support enabled */

View file

@ -25,10 +25,9 @@
#include <_ansi.h> #include <_ansi.h>
int snprintf (char *buf, size_t size, const char *fmt, ...) int snprintf (char *buf, size_t size, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4); ATTRIBUTE_PRINTF(3, 4);
int vsnprintf (char *buf, int size, const char *fmt, va_list ap); int vsnprintf (char *buf, int size, const char *fmt, va_list ap);
int fdprintf (int fd, const char *fmt, ...) int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
ATTRIBUTE_PRINTF(2, 3);
#endif /* __SPRINTF_H__ */ #endif /* __SPRINTF_H__ */