On Thu, Jul 03, 2008 at 01:17:00AM -0700, Mladen Nikitovic wrote:
> Hi,
> 
> I'm trying to define a macro intended to be used in OpenSolaris kernel code 
> on a sparc architecture :
> 
> #define MAGIC(service) do { \
>         asm("sethi %0,%%g0" : : "g" (service)); \
> } while (0)
> 
> But if i try to insert the MAGIC call (MAGIC(1000); for instance)in kernel 
> code (inside disp.c) and recompile the kernel using SUN Studio compiler i get 
> these compiler errors:
> 
> ../../sun -nostdinc -I../../common -DGLREG -c -o /tmp/.cwCAA91q32h.o 
> ../../common/disp/disp.c
> ../../common/disp/disp.c: In function `idle_enter':
> ../../common/disp/disp.c:551: error: syntax error before ':' token

This error message does not look like it is emitted by Sun C compiler.
It is more like gcc.

> 
> It seem to complain about the ':' and I don't know how to correct it. I have 
> tried millions of variants derived from examples on the web, but with no 
> success.

It works for me on Sun Studio 12 C compiler.

regards,
  Fedor..

Reply via email to