new cpp preprocessor fails

jarausch@igpm.rwth-aachen.de jarausch@igpm.rwth-aachen.de
Wed Nov 15 00:54:00 GMT 2000


On 14 Nov, Neil Booth wrote:
> Please provide all the macros needed to reproduce your result.

OK, I've boiled it down to
-------------------------------------------------------------------------------

#define UNUSED __attribute__((__unused__))
#define INLINE __inline__
#  define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED
#define M 8
INLINE_SIM_ENDIAN(unsigned_8) endian_t2h_8(unsigned_8 x);
#define T2H_8(X) endian_t2h_8(X)

#define CONCAT2(a,b)	 a##b
#define XCONCAT2(a,b)     CONCAT2(a,b)
#define unsigned_M XCONCAT2(unsigned_,M)

#define T2H_M XCONCAT2(T2H_,M)

/* the following 2 lines are just a workaround */
      typedef unsigned_M HJ_Type;
      val = T2H_M (*( HJ_Type *) sim_core_translate (mapping, addr));

/* the following line expands to
      val = endian_t2h_8(*(XCONCAT2(unsigned_,8)*) sim_core_translate (mapping, 
*/
      val = T2H_M (*(unsigned_M*) sim_core_translate (mapping, addr));
      
-------------------------------------------------------------------------------

-- 
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany



More information about the Gcc-bugs mailing list