MT#57424 format '%d' expects argument of type 'int', but argument 4 has type 'long int'

This commit takes care of this:

     ../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
       143 |   _LOG(L_DBG, error_category " " fmt, ##args)
     ../../core/log.h:121:45: note: in definition of macro '_LOG'
       121 |       int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args);  \
           |                                             ^~~
     ../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
       166 | #define DBG(fmt, args...)   CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
           |                             ^~~~~~~
     DBRegAgent.cpp:298:4: note: in expansion of macro 'DBG'
       298 |    DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
           |    ^~~
     DBRegAgent.cpp:298:62: note: format string is defined here
       298 |    DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
           |                                                             ~^
           |                                                              |
           |                                                              int
           |                                                             %ld

     ../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
       143 |   _LOG(L_DBG, error_category " " fmt, ##args)
     ../../core/log.h:121:45: note: in definition of macro '_LOG'
       121 |       int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args);  \
           |                                             ^~~
     ../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
       166 | #define DBG(fmt, args...)   CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
           |                             ^~~~~~~
     DBRegAgent.cpp:423:7: note: in expansion of macro 'DBG'
       423 |       DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
           |       ^~~
     DBRegAgent.cpp:423:62: note: format string is defined here
       423 |       DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
           |                                                             ~^
           |                                                              |
           |                                                              int
           |                                                             %ld

Change-Id: I088f9a1a2861d1f7aae7b7cab84ce0e66b3127c2
mr11.4.1
Donat Zenichev 3 years ago
parent f0961c7f17
commit d1474f6537

@ -295,7 +295,7 @@ bool DBRegAgent::loadRegistrations() {
continue;
}
DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
DBG("REGISTER: Triggering for subscriber with object_id=<%ld>\n", object_id);
string contact_uri;
if (db_read_contact && row[COLNAME_CONTACT] != mysqlpp::null) {
@ -420,7 +420,7 @@ bool DBRegAgent::loadRegistrationsPeerings() {
continue;
}
DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
DBG("REGISTER: Triggering for peering with object_id=<%ld>\n", object_id);
string contact_uri;
if (db_read_contact && row[COLNAME_CONTACT] != mysqlpp::null) {

Loading…
Cancel
Save