From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Booth To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: preprocessor/3049: Conditional compilation using "#if A==B" broken on i386 Red Hat 7.0. Date: Mon, 04 Jun 2001 15:36:00 -0000 Message-id: <20010604223601.2792.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00103.html List-Id: The following reply was made to PR preprocessor/3049; it has been noted by GNATS. From: Neil Booth To: behanna@zbzoom.net Cc: gcc-gnats@gcc.gnu.org Subject: Re: preprocessor/3049: Conditional compilation using "#if A==B" broken on i386 Red Hat 7.0. Date: Mon, 4 Jun 2001 23:35:06 +0100 behanna@zbzoom.net wrote:- > #if BYTE_ORDER == BIG_ENDIAN > // stuff > #endif > #if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN > // stuff > #endif > results in both sections of code getting processed on Red Hat 7.0 if > _XOPEN_SOURCE is defined. The problem does not occur if _XOPEN_SOURCE > is not defined. The attached program reproduces this problem. That raises the obvious question: can you tell me what are the values of BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER and PDP_ENDIAN when you define _XOPEN_SOURCE? (e.g. put them through a printf). I'd be extremely suprised if this is a CPP bug, but if it is we need to fix it quickly. Neil.