Rajmohan Banavi
2016-10-20 14:12:00 UTC
Hi,
I am looking to build an app using the libnetsnmp library and observed that
there are multiple redundant redeclarations of functions. I have pasted
some of them which are output by the compiler.
Why are there multiple declarations for the same functions? Is there any
way to avoid these warnings (say by disabling UCD)?
Thanks,
Rajmohan
../../../net-snmp/include/net-snmp/net-snmp-includes.h:54:5: error:
"HAVE_DMALLOC_H" is not defined [-Werror=undef]
#if HAVE_DMALLOC_H
^
In file included from ../../../net-snmp/include/net-snmp/output_api.h:151:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_logging.h:122:6: *error:
redundant redeclaration of ânetsnmp_logging_restartâ *
[-Werror=redundant-decls]
void netsnmp_logging_restart(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:54:10: *note: previous
declaration of ânetsnmp_logging_restartâ was here*
void netsnmp_logging_restart(void);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:48:21: *error: redundant
redeclaration of âsnmp_set_mib_warningsâ* [-Werror=redundant-decls]
void snmp_set_mib_warnings(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:40:17: *note:
previous declaration of âsnmp_set_mib_warningsâ was here*
void snmp_set_mib_warnings(int);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:50:21: *error: redundant
redeclaration of âsnmp_set_mib_errorsâ* [-Werror=redundant-decls]
void snmp_set_mib_errors(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:42:17: *note:
previous declaration of âsnmp_set_mib_errorsâ was here*
void snmp_set_mib_errors(int);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:52:21: *error: redundant
redeclaration of âsnmp_set_save_descriptionsâ* [-Werror=redundant-decls]
void snmp_set_save_descriptions(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:44:17: *note:
previous declaration of âsnmp_set_save_descriptionsâ was here*
void snmp_set_save_descriptions(int);
^
In file included from ../../../net-snmp/include/net-snmp/types.h:421:0,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_api.h:472:21: *error:
redundant redeclaration of âsnmp_set_do_debuggingâ*
[-Werror=redundant-decls]
void snmp_set_do_debugging(int);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:125:21: *note: previous
declaration of âsnmp_set_do_debuggingâ was here*
void snmp_set_do_debugging(int);
^
In file included from ../../../net-snmp/include/net-snmp/types.h:421:0,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_api.h:474:21: *error:
redundant redeclaration of âsnmp_get_do_debuggingâ*
[-Werror=redundant-decls]
int snmp_get_do_debugging(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:127:21: *note: previous
declaration of âsnmp_get_do_debuggingâ was here*
int snmp_get_do_debugging(void);
^
In file included from ../../../net-snmp/include/net-snmp/utilities.h:55:0,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:71,
from test.c:52:
../../../net-snmp/include/net-snmp/library/container_binary_array.h:38:10:
*error:
redundant redeclaration of ânetsnmp_container_binary_array_initâ*
[-Werror=redundant-decls]
void netsnmp_container_binary_array_init(void);
^
../../../net-snmp/include/net-snmp/library/container_binary_array.h:20:10:
*note:
previous declaration of ânetsnmp_container_binary_array_initâ was here*
void netsnmp_container_binary_array_init(void);
^
In file included from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:76:0,
from test.c:52:
../../../net-snmp/include/net-snmp/config_api.h:38:21: *error: redundant
redeclaration of âregister_mib_handlersâ* [-Werror=redundant-decls]
void register_mib_handlers(void);
^
In file included from
../../../net-snmp/include/net-snmp/varbind_api.h:103:0,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/mib.h:122:21: *note: previous
declaration of âregister_mib_handlersâ was here*
void register_mib_handlers(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmpv3-security-includes.h:2:0,
from ../../../net-snmp/include/net-snmp/snmpv3_api.h:36,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:78,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmpusm.h:185:21: *error:
redundant redeclaration of âusm_secmod_generate_out_msgâ*
[-Werror=redundant-decls]
SecmodOutMsg usm_secmod_generate_out_msg;
^
../../../net-snmp/include/net-snmp/library/snmpusm.h:184:21: *note:
previous declaration of âusm_secmod_generate_out_msgâ was here*
SecmodOutMsg usm_secmod_generate_out_msg;
I am looking to build an app using the libnetsnmp library and observed that
there are multiple redundant redeclarations of functions. I have pasted
some of them which are output by the compiler.
Why are there multiple declarations for the same functions? Is there any
way to avoid these warnings (say by disabling UCD)?
Thanks,
Rajmohan
../../../net-snmp/include/net-snmp/net-snmp-includes.h:54:5: error:
"HAVE_DMALLOC_H" is not defined [-Werror=undef]
#if HAVE_DMALLOC_H
^
In file included from ../../../net-snmp/include/net-snmp/output_api.h:151:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_logging.h:122:6: *error:
redundant redeclaration of ânetsnmp_logging_restartâ *
[-Werror=redundant-decls]
void netsnmp_logging_restart(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:54:10: *note: previous
declaration of ânetsnmp_logging_restartâ was here*
void netsnmp_logging_restart(void);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:48:21: *error: redundant
redeclaration of âsnmp_set_mib_warningsâ* [-Werror=redundant-decls]
void snmp_set_mib_warnings(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:40:17: *note:
previous declaration of âsnmp_set_mib_warningsâ was here*
void snmp_set_mib_warnings(int);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:50:21: *error: redundant
redeclaration of âsnmp_set_mib_errorsâ* [-Werror=redundant-decls]
void snmp_set_mib_errors(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:42:17: *note:
previous declaration of âsnmp_set_mib_errorsâ was here*
void snmp_set_mib_errors(int);
^
In file included from ../../../net-snmp/include/net-snmp/library/mib.h:37:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:103,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/mib_api.h:52:21: *error: redundant
redeclaration of âsnmp_set_save_descriptionsâ* [-Werror=redundant-decls]
void snmp_set_save_descriptions(int);
^
In file included from
../../../net-snmp/include/net-snmp/session_api.h:309:0,
from
../../../net-snmp/include/net-snmp/library/snmp_client.h:33,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/ucd_compat.h:44:17: *note:
previous declaration of âsnmp_set_save_descriptionsâ was here*
void snmp_set_save_descriptions(int);
^
In file included from ../../../net-snmp/include/net-snmp/types.h:421:0,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_api.h:472:21: *error:
redundant redeclaration of âsnmp_set_do_debuggingâ*
[-Werror=redundant-decls]
void snmp_set_do_debugging(int);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:125:21: *note: previous
declaration of âsnmp_set_do_debuggingâ was here*
void snmp_set_do_debugging(int);
^
In file included from ../../../net-snmp/include/net-snmp/types.h:421:0,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmp_api.h:474:21: *error:
redundant redeclaration of âsnmp_get_do_debuggingâ*
[-Werror=redundant-decls]
int snmp_get_do_debugging(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmp_client.h:32:0,
from ../../../net-snmp/include/net-snmp/varbind_api.h:102,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/output_api.h:127:21: *note: previous
declaration of âsnmp_get_do_debuggingâ was here*
int snmp_get_do_debugging(void);
^
In file included from ../../../net-snmp/include/net-snmp/utilities.h:55:0,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:71,
from test.c:52:
../../../net-snmp/include/net-snmp/library/container_binary_array.h:38:10:
*error:
redundant redeclaration of ânetsnmp_container_binary_array_initâ*
[-Werror=redundant-decls]
void netsnmp_container_binary_array_init(void);
^
../../../net-snmp/include/net-snmp/library/container_binary_array.h:20:10:
*note:
previous declaration of ânetsnmp_container_binary_array_initâ was here*
void netsnmp_container_binary_array_init(void);
^
In file included from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:76:0,
from test.c:52:
../../../net-snmp/include/net-snmp/config_api.h:38:21: *error: redundant
redeclaration of âregister_mib_handlersâ* [-Werror=redundant-decls]
void register_mib_handlers(void);
^
In file included from
../../../net-snmp/include/net-snmp/varbind_api.h:103:0,
from
../../../net-snmp/include/net-snmp/library/snmp_api.h:28,
from ../../../net-snmp/include/net-snmp/types.h:421,
from ../../../net-snmp/include/net-snmp/definitions.h:22,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:67,
from test.c:52:
../../../net-snmp/include/net-snmp/library/mib.h:122:21: *note: previous
declaration of âregister_mib_handlersâ was here*
void register_mib_handlers(void);
^
In file included from
../../../net-snmp/include/net-snmp/library/snmpv3-security-includes.h:2:0,
from ../../../net-snmp/include/net-snmp/snmpv3_api.h:36,
from
../../../net-snmp/include/net-snmp/net-snmp-includes.h:78,
from test.c:52:
../../../net-snmp/include/net-snmp/library/snmpusm.h:185:21: *error:
redundant redeclaration of âusm_secmod_generate_out_msgâ*
[-Werror=redundant-decls]
SecmodOutMsg usm_secmod_generate_out_msg;
^
../../../net-snmp/include/net-snmp/library/snmpusm.h:184:21: *note:
previous declaration of âusm_secmod_generate_out_msgâ was here*
SecmodOutMsg usm_secmod_generate_out_msg;