From mboxrd@z Thu Jan 1 00:00:00 1970 From: quanstro@quanstro.net (erik quanstrom) Date: Tue, 8 Mar 2011 12:16:29 -0500 Subject: [9fans] 8c puzzling behavior Message-ID: Topicbox-Message-UUID: b9139e9c-ead6-11e9-9d60-3106f5b1d025 for this uvlong u, i; i = 31; u = 0xff00000000000000ull; i get u & 1< 0xff00000000000000ull u & 0x80000000 -> 0 u & (int)0x80000000 -> 0xff00000000000000ull u & -2147483648 -> 0 to put a finer point on it, (uvlong)(1< 0xffffffff80000000 (uvlong)(0x80000000) -> 0x80000000 (uvlong)(int)0x80000000 -> 0xffffffff80000000 (uvlong)-2147483648 -> 0x80000000 so it seems clear that constants are treated as if unsigned, regardless, but variables are not? can this be correct? i hate to hazzard guesses about the c standard. - erik