Author: tridge Date: 2006-09-27 02:00:13 +0000 (Wed, 27 Sep 2006) New Revision: 18936
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18936 Log: hopefully fix the test for negative enum values. When a compiler truncates the enums, the test was passing. Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4 Changeset: Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4 =================================================================== --- branches/SAMBA_4_0/source/build/m4/check_cc.m4 2006-09-26 23:43:58 UTC (rev 18935) +++ branches/SAMBA_4_0/source/build/m4/check_cc.m4 2006-09-27 02:00:13 UTC (rev 18936) @@ -37,17 +37,11 @@ enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; int main(void) { enum negative_values v1 = NEGATIVE_VALUE; - unsigned v2 = NEGATIVE_VALUE; - - if (v1 != 0xFFFFFFFF) { - printf("%u != 0xFFFFFFFF\n", v1); + unsigned v2 = 0xFFFFFFFF; + if (v1 != v2) { + printf("v1=0x%08x v2=0x%08x\n", v1, v2); return 1; } - if (v2 != 0xFFFFFFFF) { - printf("%u != 0xFFFFFFFF\n", v2); - return 1; - } - return 0; } ],
