![]() |
![]() |
3225 | ![]() |
||||
![]() | |||||||
| Pointers | REFERENCE - ISO:C90-6.1.2.4 Storage Durations of Objects | ||||||
The address of an automatic object is being returned through a function parameter. This is dangerous. On return from this function, the local object will go out of scope and the value obtained by dereferencing the pointer will be undefined. Perhaps this object needs to be declared with static storage duration ? For example:
/*PRQA S 506,2017,3227,3408,3447 ++*/
void foo(int **appi)
{
int bi = 1;
*appi = &bi; /* Message 3225 */
return;
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |