Home | History | Annotate | Line # | Download | only in lint1
      1 /*	$NetBSD: msg_056.c,v 1.7 2024/11/20 23:01:52 rillig Exp $	*/
      2 # 3 "msg_056.c"
      3 
      4 // Test for message: constant %s too large for 'int' [56]
      5 
      6 /* lint1-extra-flags: -h */
      7 
      8 enum {
      9 	S31_MAX = 0x7FFFFFFF,
     10 	U31_MAX = 0x7FFFFFFFU,
     11 
     12 	// The hexadecimal constant has type 'int', since it fits.
     13 	/* expect+1: warning: '2147483647 + 1' overflows 'int' [141] */
     14 	S31_MAX_PLUS_1 = 0x7FFFFFFF + 1,
     15 
     16 	/* expect+1: warning: constant 0x80000000 too large for 'int' [56] */
     17 	U31_MAX_PLUS_1 = 0x7FFFFFFFU + 1,
     18 
     19 
     20 	/* expect+1: warning: constant 0xffffffff too large for 'int' [56] */
     21 	U32_MAX = 0xFFFFFFFF,
     22 
     23 	/* expect+2: warning: '9223372036854775807 + 1' overflows 'long long' [141] */
     24 	/* expect+1: warning: constant 0x7fffffffffffffff too large for 'int' [56] */
     25 	S63_MAX_PLUS_1 = 0x7FFFFFFFFFFFFFFFLL + 1,
     26 
     27 	/* expect+1: warning: constant -0x8000000000000000 too large for 'int' [56] */
     28 	S63_MIN = -0x7FFFFFFFFFFFFFFF - 1,
     29 
     30 	/* expect+1: warning: constant 0x7fffffffffffffff too large for 'int' [56] */
     31 	S63_MAX = 0x7FFFFFFFFFFFFFFF,
     32 
     33 	/* expect+1: warning: constant 0x7fffffffffffffff too large for 'int' [56] */
     34 	U63_MAX = 0x7FFFFFFFFFFFFFFFU,
     35 
     36 	/* expect+1: warning: constant 0x8000000000000000 too large for 'int' [56] */
     37 	U63_MAX_PLUS_1 = 0x8000000000000000U,
     38 
     39 	/* expect+1: warning: constant 0xffffffffffffffff too large for 'int' [56] */
     40 	U64_MAX = 0xFFFFFFFFFFFFFFFF,
     41 
     42 	/* expect+2: warning: integer constant out of range [252] */
     43 	/* expect+1: warning: constant 0xffffffffffffffff too large for 'int' [56] */
     44 	U80_MAX = 0xFFFFFFFFFFFFFFFFFFFF,
     45 };
     46