[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] __RING_SIZE() macro not aconstant when compiling under windows



> When I try and use the __RING_SIZE() macro under windows as the size of
> an array, the ddk compiler complains that it's not a constant
> expression. The exact error it gives is
>
> "
> c:\projects\xen\xenvbd\xenvbd.h(43) : error C2057: expected constant
> expression
> "
>
> Is there something special about gcc that would let this work under it
> but not under the windows compiler?

__RING_SIZE() isn't necessarily plain constant - it does calculations.  In 
practice, these can typically be evaluated at compile time (if sz is a 
constant).  I don't know the C spec well enough to know if it's appropriate 
to reject this...

But __RING_SIZE isn't (as far as I know) actually used anywhere to size 
arrays?  It's used internally by the other macros in ring.h to set up various 
book keeping.  So I'm not sure that you should necessarily need to use the 
macro this way...?

Cheers,
Mark

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.