xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_014.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: msg_014.c,v 1.7 2022/05/12 00:18:35 rillig Exp $	*/
2 # 3 "msg_014.c"
3 
4 // Test for message: compiler takes alignment of function [14]
5 /* This message is not used. */
6 
7 typedef void function(void);
8 
9 /* expect+1: error: cannot take size/alignment of function type 'function(void) returning void' [144] */
10 unsigned long alignof_function = __alignof__(function);
11 
12 struct illegal_bit_field {
13 	/* expect+1: warning: illegal bit-field type 'function(void) returning void' [35] */
14 	function bit_field:1;
15 	/* expect+1: error: function illegal in structure or union [38] */
16 	function member;
17 };
18 
19 struct s {
20 	/* expect+1: error: array of function is illegal [16] */
21 	function member[5];
22 };
23