You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A worrying warning for following code in parms_map.c
int *parms_MapGlobalToLocal(parms_Map self, int gindex)
{
int *lindex;
if(self->isserial)
lindex = &gindex;
else
lindex = parms_TableGet(self->table, gindex);
return lindex;
}
The warning is:
/perm/nawd/fesom2/lib/parms/src/parms_map.c: In function ‘parms_MapGlobalToLocal’:
/perm/nawd/fesom2/lib/parms/src/parms_map.c:744:10: warning: function may return address of local variable [-Wreturn-local-addr]
return lindex;
^~~~~~
/perm/nawd/fesom2/lib/parms/src/parms_map.c:735:49: note: declared here
int *parms_MapGlobalToLocal(parms_Map self, int gindex)
~~~~^~~~~~
This happens in the assignment of the pointerlindex to &gindex in the first part of the if statement is problematic, as gindex is a temporary in this function.
The text was updated successfully, but these errors were encountered:
A worrying warning for following code in
parms_map.c
The warning is:
This happens in the assignment of the pointer
lindex
to&gindex
in the first part of theif
statement is problematic, asgindex
is a temporary in this function.The text was updated successfully, but these errors were encountered: