11.6Srillig/*	$NetBSD: platform_int.c,v 1.6 2023/07/09 10:42:07 rillig Exp $	*/
21.1Srillig# 3 "platform_int.c"
31.1Srillig
41.1Srillig/*
51.1Srillig * Test features that only apply to platforms on which size_t is unsigned
61.1Srillig * int and ptr_diff is signed int.
71.1Srillig */
81.1Srillig
91.1Srillig/* lint1-only-if: int */
101.5Srillig/* lint1-flags: -g -w -c -h -a -p -b -r -z -X 351 */
111.1Srillig
121.1Srilligvoid to_size(typeof(sizeof(int)));
131.1Srillig
141.3Srillig/* See should_warn_about_prototype_conversion. */
151.1Srilligvoid
161.1Srilligconvert_unsigned_char_to_size(unsigned char uc)
171.1Srillig{
181.3Srillig	/*
191.3Srillig	 * In this function call, uc is first promoted to INT. It is then
201.3Srillig	 * converted to size_t, which is UINT. The portable bit size of INT
211.3Srillig	 * and UINT is the same, 32, but the signedness changes, therefore
221.3Srillig	 * the warning.
231.3Srillig	 */
241.6Srillig	/* expect+1: warning: argument 1 is converted from 'unsigned char' to 'unsigned int' due to prototype [259] */
251.1Srillig	to_size(uc);
261.1Srillig}
27