support GCC __attributes__ for printf formats.

This commit is contained in:
steve 2002-05-24 19:05:30 +00:00
parent d63e994ea5
commit 6ede18d41c
3 changed files with 30 additions and 7 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: veriuser.h,v 1.2 2002/05/23 03:35:42 steve Exp $"
#ident "$Id: veriuser.h,v 1.3 2002/05/24 19:05:30 steve Exp $"
#endif
/*
@ -39,9 +39,15 @@
# define EXTERN_C_END
#endif
#ifndef __GNUC__
# undef __attribute__
# define __attribute__(x)
#endif
EXTERN_C_START
extern void io_printf (const char *, ...);
extern void io_printf (const char *, ...)
__attribute__((format (printf,1,2)));
extern int tf_dofinish(void);
extern int tf_dostop(void);
@ -50,6 +56,9 @@ EXTERN_C_END
/*
* $Log: veriuser.h,v $
* Revision 1.3 2002/05/24 19:05:30 steve
* support GCC __attributes__ for printf formats.
*
* Revision 1.2 2002/05/23 03:35:42 steve
* Add the io_printf function to libveriuser.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: sys_display.c,v 1.36 2002/04/06 20:25:45 steve Exp $"
#ident "$Id: sys_display.c,v 1.37 2002/05/24 19:05:30 steve Exp $"
#endif
# include "config.h"
@ -290,7 +290,7 @@ static int format_str(vpiHandle scope, unsigned int mcd,
} else {
vpi_get_value(argv[idx], &value);
if (value.format == vpiSuppressVal){
vpi_printf("\nERROR: parameter does not have a printable value!\n", fmt);
vpi_printf("\nERROR: parameter does not have a printable value!\n");
goto bail_out;
}
@ -1111,6 +1111,9 @@ void sys_display_register()
/*
* $Log: sys_display.c,v $
* Revision 1.37 2002/05/24 19:05:30 steve
* support GCC __attributes__ for printf formats.
*
* Revision 1.36 2002/04/06 20:25:45 steve
* cbValueChange automatically replays.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_user.h,v 1.10 2002/05/23 03:34:46 steve Exp $"
#ident "$Id: vpi_user.h,v 1.11 2002/05/24 19:05:30 steve Exp $"
#endif
@ -37,6 +37,11 @@
# define EXTERN_C_END
#endif
#ifndef __GNUC__
# undef __attribute__
# define __attribute__(x)
#endif
EXTERN_C_START
# include <stdarg.h>
@ -200,7 +205,9 @@ typedef struct t_vpi_value {
/* VPI FUNCTIONS */
extern void vpi_register_systf(const struct t_vpi_systf_data*ss);
extern void vpi_printf(const char*fmt, ...);
extern void vpi_printf(const char*fmt, ...)
__attribute__((format (printf,1,2)));
/* vpi_vprintf is non-standard. */
extern void vpi_vprintf(const char*fmt, va_list ap);
@ -208,7 +215,8 @@ extern unsigned int vpi_mcd_close(unsigned int mcd);
extern char *vpi_mcd_name(unsigned int mcd);
extern unsigned int vpi_mcd_open(char *name);
extern unsigned int vpi_mcd_open_x(char *name, char *mode);
extern int vpi_mcd_printf(unsigned int mcd, const char*fmt, ...);
extern int vpi_mcd_printf(unsigned int mcd, const char*fmt, ...)
__attribute__((format (printf,2,3)));
extern int vpi_mcd_fputc(unsigned int mcd, unsigned char x);
extern int vpi_mcd_fgetc(unsigned int mcd);
@ -317,6 +325,9 @@ EXTERN_C_END
/*
* $Log: vpi_user.h,v $
* Revision 1.11 2002/05/24 19:05:30 steve
* support GCC __attributes__ for printf formats.
*
* Revision 1.10 2002/05/23 03:34:46 steve
* Export the vpi_vprintf function.
*