Home | History | Annotate | Line # | Download | only in lint1
d_alignof.c revision 1.3
      1  1.3  rillig /*	$NetBSD: d_alignof.c,v 1.3 2022/05/12 00:09:44 rillig Exp $	*/
      2  1.2  rillig # 3 "d_alignof.c"
      3  1.2  rillig 
      4  1.3  rillig /* https://gcc.gnu.org/onlinedocs/gcc/Alignment.html */
      5  1.3  rillig 
      6  1.3  rillig unsigned long
      7  1.3  rillig leading_and_trailing_alignof_type(void)
      8  1.1  jruoho {
      9  1.3  rillig 	/* FIXME: '__alignof__' must be recognized. */
     10  1.3  rillig 	/* expect+2: error: function '__alignof__' implicitly declared to return int [215] */
     11  1.3  rillig 	/* expect+1: error: syntax error 'short' [249] */
     12  1.1  jruoho 	return __alignof__(short);
     13  1.1  jruoho }
     14  1.3  rillig /* expect-1: warning: function leading_and_trailing_alignof_type falls off bottom without returning value [217] */
     15  1.3  rillig 
     16  1.3  rillig unsigned long
     17  1.3  rillig leading_alignof_type(void)
     18  1.3  rillig {
     19  1.3  rillig 	return __alignof(short);
     20  1.3  rillig }
     21  1.3  rillig 
     22  1.3  rillig unsigned long
     23  1.3  rillig plain_alignof_type(void)
     24  1.3  rillig {
     25  1.3  rillig 	/* The plain word 'alignof' is not recognized by GCC. */
     26  1.3  rillig 	/* FIXME: plain 'alignof' is not defined by GCC. */
     27  1.3  rillig 	return alignof(short);
     28  1.3  rillig }
     29  1.3  rillig 
     30  1.3  rillig unsigned long
     31  1.3  rillig leading_and_trailing_alignof_expr(void)
     32  1.3  rillig {
     33  1.3  rillig 	/* FIXME: '__alignof__' must be recognized. */
     34  1.3  rillig 	/* FIXME: '__alignof__ expr' must be recognized. */
     35  1.3  rillig 	/* expect+2: error: '__alignof__' undefined [99] */
     36  1.3  rillig 	/* expect+1: error: syntax error '3' [249] */
     37  1.3  rillig 	return __alignof__ 3;
     38  1.3  rillig }
     39  1.3  rillig /* expect-1: warning: function leading_and_trailing_alignof_expr falls off bottom without returning value [217] */
     40  1.3  rillig 
     41  1.3  rillig unsigned long
     42  1.3  rillig leading_alignof_expr(void)
     43  1.3  rillig {
     44  1.3  rillig 	/* FIXME: '__alignof expr' must be recognized. */
     45  1.3  rillig 	/* expect+1: error: syntax error '3' [249] */
     46  1.3  rillig 	return __alignof 3;
     47  1.3  rillig }
     48  1.3  rillig /* expect-1: warning: function leading_alignof_expr falls off bottom without returning value [217] */
     49  1.3  rillig 
     50  1.3  rillig unsigned long
     51  1.3  rillig plain_alignof_expr(void)
     52  1.3  rillig {
     53  1.3  rillig 	/* The plain word 'alignof' is not recognized by GCC. */
     54  1.3  rillig 	/* expect+1: error: syntax error '3' [249] */
     55  1.3  rillig 	return alignof 3;
     56  1.3  rillig }
     57  1.3  rillig /* expect-1: warning: function plain_alignof_expr falls off bottom without returning value [217] */
     58