--- libelwix/inc/elwix.h 2013/07/07 21:05:58 1.7.2.1 +++ libelwix/inc/elwix.h 2013/07/08 11:50:43 1.7.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: elwix.h,v 1.7.2.1 2013/07/07 21:05:58 misho Exp $ +* $Id: elwix.h,v 1.7.2.2 2013/07/08 11:50:43 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -204,10 +204,10 @@ extern int elwix_Verbose; #define EVERBS(x) if ((x) <= elwix_Verbose) #define EVERBOSE(x, fmt, ...) do { assert((fmt)); \ if ((x) <= elwix_Verbose) { \ - char str[BUFSIZ] = { 0 }; \ - snprintf(str, sizeof str, (fmt), ##__VA_ARGS__); \ + char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \ + snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \ syslog(LOG_DEBUG, "Verbose(%d):%s(%d): %s\n", \ - (x), __func__, __LINE__, str); \ + (x), __func__, __LINE__, __str); \ } \ } while (0) @@ -222,27 +222,27 @@ extern int elwix_Debug; syslog(LOG_DEBUG, "I'm in %s(%d)\n", __func__, __LINE__) #define EDEBUG(x, fmt, ...) do { assert((fmt)); \ if ((x) & elwix_Debug) { \ - char str[BUFSIZ] = { 0 }; \ - snprintf(str, sizeof str, (fmt), ##__VA_ARGS__); \ + char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \ + snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \ syslog(LOG_DEBUG, "Debug(%d):%s(%d): %s\n", \ - (x), __func__, __LINE__, str); \ + (x), __func__, __LINE__, __str); \ } \ } while (0) /* Logger macro */ #define ELOGGER(x, fmt, ...) do { assert((fmt)); \ - char str[BUFSIZ] = { 0 }; \ - snprintf(str, sizeof str, (fmt), ##__VA_ARGS__); \ + char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \ + snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \ syslog((x), "Logger:%s(%d): %s\n", \ - __func__, __LINE__, str); \ + __func__, __LINE__, __str); \ } while (0) /* Error state macros */ #define EERROR(x, fmt, ...) do { assert((fmt)); \ - char str[BUFSIZ] = { 0 }; \ - snprintf(str, sizeof str, (fmt), ##__VA_ARGS__); \ + char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \ + snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \ syslog(LOG_ERR, "Error:%s(%d): #%d - %s\n", \ - __func__, __LINE__, (x), str); \ + __func__, __LINE__, (x), __str); \ } while (0) #define ESYSERR(x) do { \ if (x > 0 || errno) \