I'm not sure what it is that not correct. It seemed consistent with surrounding code.
Sun C compiler does accept asm keyword. It successfully compiles code such as this one:
asm("fldl (%0)" :: "a" (&output.d));
However it does not accept mingling of assembly codes with C code such as this one:
register int eax asm("eax");
I suspect this is an extension to ISO C standard by Gcc. Mind you there are slight differences in between
Gnu "as" and Sun "as" (Assembler) syntax as well even though they target same CPU architecture.
I will use one of two methods you suggested to get past this point.
The issue seems to be that compiler expects ?: operator to return identical or convertible types on both branches.
Following forms are accepted:
if(ecl_unlikely(env->bds_top >= env->bds_limit)) ecl_bds_overflow()
(ecl_unlikely(env->bds_top >= env->bds_limit)? ecl_bds_overflow() : (void*)0)
(ecl_unlikely(env->bds_top >= env->bds_limit)? ecl_bds_overflow() : (struct bds_bd *)0) (ecl_unlikely(env->bds_top >= env->bds_limit)? (ecl_bds_overflow(),1) : 0)
(ecl_unlikely(env->bds_top >= env->bds_limit)? ecl_bds_overflow() : (void)0)
I would pick the one with least amount of generated code.
From: Juan Jose Garcia-Ripoll [mailto:juanjose.garciaripoll@...]
Sent: Tuesday, 18 May 2010 8:23 PM
To: Semih Cemiloglu
Cc: ecls-list@...; semih@...
Subject: Re: [Ecls-list] ECL main trunk fails to compile on OpenSolaris
I can not incorporate the first half of your patch because it is not correct. If Sun's compiler does not allow inline assembly in the FFI code then you have two options: 1) disable the dffi code entirely (--without-dffi) or 2) link against libffi by configuring and installing this library in a place where ECL can find it.
The second patch I would suggest not adding more #ifdefs but rather use a bit more standard code. Can you please test this line instead?
#define ecl_bds_check(env) \
(ecl_unlikely(env->bds_top >= env->bds_limit)? (ecl_bds_overflow(),1) : 0)
As for the compiler, it is not just a matter of internet connection, it is a matter of finding time to set it all up.
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)