![]() |
![]() |
0456 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.3.3.2 Address and Indirection Operators - Constraints | ||||||
This is a constraint error The address-of operator & can only be applied to a function designator or an lvalue that designates an object that is not a bit-field and is not declared with the register storage-class specifier. For example:
/*PRQA S 2211,3198,3199,3203,3408,3447,3635,3672 ++*/
extern int g;
extern void func(int x);
void foo(void)
{
int *pi;
void (*pvf)(int x);
pi = &g; /* Operand of & is an lvalue */
pvf = &func; /* Operand of & is a function designator */
pvf = func; /* & is optional on a function designator */ /* See ISO-C90 6.2.2.1 */
pi = &(g + 1); /* Message 0456 */
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |