1*ea649623Srillig /* $NetBSD: init_c90.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ 2e3544adfSrillig # 3 "init_c90.c" 3e3544adfSrillig 4e3544adfSrillig /* 5e3544adfSrillig * Test initialization before C99. 6e3544adfSrillig * 7e3544adfSrillig * C90 3.5.7 8e3544adfSrillig */ 9e3544adfSrillig 10*ea649623Srillig /* lint1-flags: -sw -X 351 */ 11e3544adfSrillig 12e3544adfSrillig struct point { 13e3544adfSrillig int x, y; 14e3544adfSrillig }; 15e3544adfSrillig 16e3544adfSrillig struct point point_c90 = { 0, 0 }; 170ff5e0acSrillig /* expect+2: warning: struct or union member name in initializer is a C99 feature [313] */ 180ff5e0acSrillig /* expect+1: warning: struct or union member name in initializer is a C99 feature [313] */ 19e3544adfSrillig struct point point_c99 = { .x = 0, .y = 0 }; 20e3544adfSrillig 21e3544adfSrillig struct point points_c90[] = {{ 0, 0 }}; 220ff5e0acSrillig /* expect+1: warning: array initializer with designators is a C99 feature [321] */ 23e3544adfSrillig struct point points_c99[] = {[3] = { 0, 0 }}; 2444134297Srillig 2544134297Srillig 2644134297Srillig struct point compound_literal(void)2744134297Srilligcompound_literal(void) { 2853ed6e86Srillig /* expect+1: error: compound literals are a C99/GCC extension [319] */ 2944134297Srillig return (struct point){ 0, 0 }; 3044134297Srillig } 31