printf: use compiler __attribute__((format (printf,fff,aaa)))
This commit is contained in:
parent
f80540af46
commit
94ec5cf98f
|
|
@ -65,7 +65,7 @@ extern bool CalmaWrite(CellDef *rootDef, FILE *f);
|
||||||
extern void CalmaReadFile(FILETYPE file, char *filename);
|
extern void CalmaReadFile(FILETYPE file, char *filename);
|
||||||
extern void CalmaTechInit(void);
|
extern void CalmaTechInit(void);
|
||||||
extern bool CalmaGenerateArray(FILE *f, TileType type, int llx, int lly, int pitch, int cols, int rows);
|
extern bool CalmaGenerateArray(FILE *f, TileType type, int llx, int lly, int pitch, int cols, int rows);
|
||||||
extern void CalmaReadError(char *format, ...);
|
extern void CalmaReadError(char *format, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
|
|
||||||
/* C99 compat */
|
/* C99 compat */
|
||||||
extern void calmaDelContacts(void);
|
extern void calmaDelContacts(void);
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,8 @@ extern int CIFEdgeDirection(CIFPath *first, CIFPath *last);
|
||||||
|
|
||||||
/* Variable argument procedures require complete prototype */
|
/* Variable argument procedures require complete prototype */
|
||||||
|
|
||||||
extern void CIFReadError(char *format, ...);
|
extern void CIFReadError(char *format, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
extern void CIFReadWarning(char *format, ...);
|
extern void CIFReadWarning(char *format, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
|
|
||||||
/* Variables shared by the CIF-reading modules, see CIFreadutils.c
|
/* Variables shared by the CIF-reading modules, see CIFreadutils.c
|
||||||
* for more details:
|
* for more details:
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,8 @@ void LefReadLayerSection();
|
||||||
|
|
||||||
LefMapping *defMakeInverseLayerMap();
|
LefMapping *defMakeInverseLayerMap();
|
||||||
|
|
||||||
void LefError(int, char *, ...); /* Variable argument procedure requires */
|
/* Variable argument procedure requires parameter list. */
|
||||||
/* parameter list. */
|
void LefError(int, char *, ...) ATTR_FORMAT_PRINTF_2;
|
||||||
|
|
||||||
/* C99 compat */
|
/* C99 compat */
|
||||||
extern void LefRead();
|
extern void LefRead();
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,10 @@ extern void TxUseMore();
|
||||||
extern void TxStopMore();
|
extern void TxStopMore();
|
||||||
|
|
||||||
/* printing procedures with variable arguments lists */
|
/* printing procedures with variable arguments lists */
|
||||||
extern void TxError(char *, ...);
|
extern void TxError(char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
extern void TxErrorV(char *, va_list args);
|
extern void TxErrorV(char *, va_list args);
|
||||||
extern void TxPrintf(char *, ...);
|
extern void TxPrintf(char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
extern char *TxPrintString(char *, ...);
|
extern char *TxPrintString(char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
|
|
||||||
/* input procedures */
|
/* input procedures */
|
||||||
extern char *TxGetLinePrompt();
|
extern char *TxGetLinePrompt();
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ extern bool TxGetInputEvent();
|
||||||
|
|
||||||
/* Routines with variable argument lists */
|
/* Routines with variable argument lists */
|
||||||
|
|
||||||
extern void txFprintfBasic(FILE *, ...);
|
extern void txFprintfBasic(FILE *, const char *fmt, ...) ATTR_FORMAT_PRINTF_2;
|
||||||
|
|
||||||
/* C99 compat */
|
/* C99 compat */
|
||||||
void txCommandsInit();
|
void txCommandsInit();
|
||||||
|
|
|
||||||
|
|
@ -76,13 +76,11 @@ static bool txPrintFlag = TRUE;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
txFprintfBasic(FILE *f, ...)
|
txFprintfBasic(FILE *f, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char *fmt;
|
|
||||||
|
|
||||||
va_start(args, f);
|
va_start(args, fmt);
|
||||||
fmt = va_arg(args, char *);
|
|
||||||
Vfprintf(f, fmt, args);
|
Vfprintf(f, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,16 @@ extern char AbortMessage[];
|
||||||
#define PaLockZOpen PaLockOpen
|
#define PaLockZOpen PaLockOpen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ------------ modern compiler support -------------------------------- */
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
#define ATTR_FORMAT_PRINTF_1 __attribute__((format (printf,1,2)))
|
||||||
|
#define ATTR_FORMAT_PRINTF_2 __attribute__((format (printf,2,3)))
|
||||||
|
#else
|
||||||
|
#define ATTR_FORMAT_PRINTF_1 /* */
|
||||||
|
#define ATTR_FORMAT_PRINTF_2 /* */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------- Start of Machine Configuration Section ----------------- */
|
/* ---------------- Start of Machine Configuration Section ----------------- */
|
||||||
|
|
||||||
/* ------- Configuration: Handle Missing Routines/Definitions ------- */
|
/* ------- Configuration: Handle Missing Routines/Definitions ------- */
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ extern bool TechOverridesDefault; /* Set TRUE if technology was specified on
|
||||||
|
|
||||||
/* ----------------- Exported procedures ---------------- */
|
/* ----------------- Exported procedures ---------------- */
|
||||||
|
|
||||||
extern void TechError(char *, ...);
|
extern void TechError(char *, ...) ATTR_FORMAT_PRINTF_1;
|
||||||
extern void TechAddClient();
|
extern void TechAddClient();
|
||||||
extern void TechAddAlias();
|
extern void TechAddAlias();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue