Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
The following code snippet triggers "declaration shadows a local variable" warning:
static void rsaShm_overlayProperties(celix_properties_t *additionalProperties, celix_properties_t *serviceProperties) {
/*The property keys of a service are case-insensitive,while the property keys of the specified additional properties map are case sensitive.
* A property key in the additional properties map must therefore override any case variant property key in the properties of the specified Service Reference.*/
const char *additionalPropKey = NULL;
const char *servicePropKey = NULL;
PROPERTIES_FOR_EACH(additionalProperties, additionalPropKey) {
if (strcmp(additionalPropKey,(char*) OSGI_FRAMEWORK_OBJECTCLASS) != 0
&& strcmp(additionalPropKey,(char*) OSGI_FRAMEWORK_SERVICE_ID) != 0) {
bool propKeyCaseEqual = false;
PROPERTIES_FOR_EACH(serviceProperties, servicePropKey) {
if (strcasecmp(additionalPropKey,servicePropKey) == 0) {
const char* val = celix_properties_get(additionalProperties,additionalPropKey,NULL);
celix_properties_set(serviceProperties,servicePropKey,val);
propKeyCaseEqual = true;
break;
}
}
if (!propKeyCaseEqual) {
const char* val = celix_properties_get(additionalProperties,additionalPropKey,NULL);
celix_properties_set(serviceProperties,additionalPropKey,val);
}
}
}
return;
}
A closer look reveals that the iter of the inner loop hides that of the outer loop.
The following code snippet triggers "declaration shadows a local variable" warning:
A closer look reveals that the
iter
of the inner loop hides that of the outer loop.