Home | History | Annotate | Line # | Download | only in lint1
platform_ilp32_int.c revision 1.2
      1  1.2  rillig /*	$NetBSD: platform_ilp32_int.c,v 1.2 2023/03/28 14:44:35 rillig Exp $	*/
      2  1.1  rillig # 3 "platform_ilp32_int.c"
      3  1.1  rillig 
      4  1.1  rillig /*
      5  1.1  rillig  * Test features that only apply to platforms that have 32-bit int, long and
      6  1.1  rillig  * pointer types and where size_t is unsigned int, not unsigned long.
      7  1.1  rillig  */
      8  1.1  rillig 
      9  1.1  rillig /* lint1-only-if: ilp32 int */
     10  1.2  rillig /* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */
     11  1.1  rillig 
     12  1.1  rillig int s32;
     13  1.1  rillig unsigned int u32;
     14  1.1  rillig long sl32;
     15  1.1  rillig unsigned long ul32;
     16  1.1  rillig 
     17  1.1  rillig void
     18  1.1  rillig convert_between_int_and_long(void)
     19  1.1  rillig {
     20  1.1  rillig 	/*
     21  1.1  rillig 	 * No warning about possible loss of accuracy, as the types have the
     22  1.1  rillig 	 * same size, both in target platform mode as well as in portable
     23  1.1  rillig 	 * mode.
     24  1.1  rillig 	 */
     25  1.1  rillig 	s32 = sl32;
     26  1.1  rillig 	sl32 = s32;
     27  1.1  rillig 	u32 = ul32;
     28  1.1  rillig 	ul32 = u32;
     29  1.1  rillig }
     30