Home | History | Annotate | Line # | Download | only in lint1
msg_014.c revision 1.5
      1 /*	$NetBSD: msg_014.c,v 1.5 2022/04/02 21:47:04 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