![]() |
![]() |
1020 | ![]() |
||||
![]() | |||||||
| Language extensions | |||||||
The '__typeof__' operator has been used. Message 1020 identifies instances of this language extension. __typeof__ can be used in much the same way as 'sizeof'. Instead of returning a value (the size of an expression or type) it returns a type (the type of the expression or type that is supplied as an operand). __typeof__ is most frequently employed in macros for generating declarations or casts that use the same type as some expression or typename supplied as an argument to the macro. For example:
/*PRQA S 2017,3220,3408,3410,3429,3431,3435,3447,3456,3458 ++*/
#define typeof __typeof__
#define SWAP(a, b) { typeof(a) temp; temp = a; a = b; b = temp; }
extern long x;
extern long y;
extern void foo(void)
{
SWAP(x, y) /* Message 1020 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |