diff options
-rw-r--r-- | sim/common/ChangeLog | 7 | ||||
-rw-r--r-- | sim/common/sim-trace.h | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 5ec5975..e8c67fc 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,10 @@ +Mon May 5 14:08:34 1997 Mike Meissner <meissner@cygnus.com> + + * sim-trace.h (__attribute__): Define as nothing if not GNU C or + GNU C doesn't support __attributes__. + ({trace,debug}_printf): Add attribute's so -Wformat can check the + format strings. + Mon May 5 11:16:12 1997 Andrew Cagney <cagney@b1.cygnus.com> * sim-config.h (FORCED_ALIGNMENT): New alignment option - diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h index 2a98808..b400b2d 100644 --- a/sim/common/sim-trace.h +++ b/sim/common/sim-trace.h @@ -23,6 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef SIM_TRACE_H #define SIM_TRACE_H +#ifndef __attribute__ +#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNU_MINOR__ < 7) +#define __attribute__(attr) +#endif +#endif + /* Maximum number of traceable entities. */ #ifndef MAX_TRACE_VALUES #define MAX_TRACE_VALUES 12 @@ -105,7 +111,8 @@ struct _sim_cpu; /* Non-zero if "--trace-fpu" specified for CPU. */ #define TRACE_FPU_P(cpu) TRACE_P (cpu, TRACE_FPU_IDX) -extern void trace_printf PARAMS ((SIM_DESC, sim_cpu *, const char *, ...)); +extern void trace_printf PARAMS ((SIM_DESC, sim_cpu *, const char *, ...)) + __attribute__((format (printf, 3, 4))); /* Debug support. This is included here because there isn't enough of it to justify @@ -119,6 +126,7 @@ extern void trace_printf PARAMS ((SIM_DESC, sim_cpu *, const char *, ...)); /* Non-zero if "--debug-insn" specified. */ #define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX) -extern void debug_printf PARAMS ((struct _sim_cpu *, const char *, ...)); +extern void debug_printf PARAMS ((struct _sim_cpu *, const char *, ...)) + __attribute__((format (printf, 2, 3))); #endif /* SIM_TRACE_H */ |