2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Use GCC's format attribute for better error checking when possible.

This commit is contained in:
Brian Wellington
2000-06-19 18:02:32 +00:00
parent 41c2511119
commit 0c7b7a19e5

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: log.h,v 1.22 2000/06/01 17:20:40 tale Exp $ */
/* $Id: log.h,v 1.23 2000/06/19 18:02:32 bwelling Exp $ */
#ifndef ISC_LOG_H
#define ISC_LOG_H 1
@@ -29,6 +29,17 @@
ISC_LANG_BEGINDECLS
/*
* fmt is the location of the format string parameter
* args is the location of the first argument (or 0 for no argument checking)
* Note: the first parameter is 1, not 0
*/
#ifdef __GNUC__
#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((format (printf, fmt, args)))
#else
#define ISC_FORMAT_PRINTF(fmt, args)
#endif
/*
* Severity levels, patterned after Unix's syslog levels.
*
@@ -498,7 +509,8 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
void
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...);
isc_logmodule_t *module, int level, const char *format, ...)
ISC_FORMAT_PRINTF(5, 6);
/*
* Write a message to the log channels.
*
@@ -517,7 +529,7 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
* range of known ids, as estabished by isc_log_registercategories()
* and isc_log_registermodules().
*
* level != ISC_LOG_DYNAMiC. ISC_LOG_DYNAMIC is used only to define
* level != ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
* channels, and explicit debugging level must be identified for
* isc_log_write() via ISC_LOG_DEBUG(level).
*
@@ -535,7 +547,8 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
void
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format,
va_list args);
va_list args)
ISC_FORMAT_PRINTF(5, 0);
/*
* Write a message to the log channels.
*
@@ -554,7 +567,7 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
* range of known ids, as estabished by isc_log_registercategories()
* and isc_log_registermodules().
*
* level != ISC_LOG_DYNAMiC. ISC_LOG_DYNAMIC is used only to define
* level != ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
* channels, and explicit debugging level must be identified for
* isc_log_write() via ISC_LOG_DEBUG(level).
*
@@ -571,7 +584,8 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
void
isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...);
isc_logmodule_t *module, int level, const char *format, ...)
ISC_FORMAT_PRINTF(5, 6);
/*
* Write a message to the log channels, pruning duplicates that occur within
* a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
@@ -581,7 +595,8 @@ isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
void
isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format,
va_list args);
va_list args)
ISC_FORMAT_PRINTF(5, 0);
/*
* Write a message to the log channels, pruning duplicates that occur within
* a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).