xref: /netbsd/tests/usr.bin/xlint/lint1/msg_014.c (revision ea649623)
1 /*	$NetBSD: msg_014.c,v 1.8 2023/03/28 14:44:34 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 /* lint1-extra-flags: -X 351 */
8 
9 typedef void function(void);
10 
11 /* expect+1: error: cannot take size/alignment of function type 'function(void) returning void' [144] */
12 unsigned long alignof_function = __alignof__(function);
13 
14 struct illegal_bit_field {
15 	/* expect+1: warning: illegal bit-field type 'function(void) returning void' [35] */
16 	function bit_field:1;
17 	/* expect+1: error: function illegal in structure or union [38] */
18 	function member;
19 };
20 
21 struct s {
22 	/* expect+1: error: array of function is illegal [16] */
23 	function member[5];
24 };
25