Discussion:
multiple redundant redeclaration of functions
Rajmohan Banavi
2016-10-20 14:12:00 UTC
Permalink
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;

Loading...