[previous] 1023 [next] [C] Using '__alignof__' on function types is illegal.
Constraint violations

This is a constraint error

The operand of the __alignof__ operator cannot be of function type.

'__alignof__' is not part of the standard C language. It is supported by the GCC compiler as an operator that returns the alignment requirements in bytes of its operand.

For example:


/*PRQA S 1022,1257,2017,3199,3203,3408 ++*/

extern void foo(void)
{
  int a;

  a = __alignof__(foo);         /* Message 1023 */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents