Enable printf attribute checking on GNU systems.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@272 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
5681c542f6
Коммит
453b91903b
@ -41,6 +41,13 @@ typedef unsigned long long uint64_t;
|
|||||||
|
|
||||||
#define LIBSSH_VERSION "libssh-0.3-svn"
|
#define LIBSSH_VERSION "libssh-0.3-svn"
|
||||||
|
|
||||||
|
/* GCC have printf type attribute check. */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
||||||
|
#else
|
||||||
|
#define PRINTF_ATTRIBUTE(a,b)
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -158,7 +165,7 @@ enum {
|
|||||||
#define SSH_LOG_FUNCTIONS 4 // every function in and return
|
#define SSH_LOG_FUNCTIONS 4 // every function in and return
|
||||||
*/
|
*/
|
||||||
/* log.c */
|
/* log.c */
|
||||||
void ssh_log(SSH_SESSION *session, int prioriry, char *format, ...);
|
void ssh_log(SSH_SESSION *session, int prioriry, const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
|
||||||
|
|
||||||
/* session.c */
|
/* session.c */
|
||||||
SSH_SESSION *ssh_new(void);
|
SSH_SESSION *ssh_new(void);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* \param verbosity verbosity of the event
|
* \param verbosity verbosity of the event
|
||||||
* \param format format string of the log entry
|
* \param format format string of the log entry
|
||||||
*/
|
*/
|
||||||
void ssh_log(SSH_SESSION *session, int verbosity, char *format, ...){
|
void ssh_log(SSH_SESSION *session, int verbosity, const char *format, ...) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
char buf2[256];
|
char buf2[256];
|
||||||
int min;
|
int min;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user