Re: [Vala] shouldn't be sizeof expression is a constant?



Hallo.

const int c = sizeof(int);

this code is not compiled. Why? It's allowed in C
I've got a similar Problem. I've tryed to complie:

private const double MAX_RG
B = (double)uint16.MAX;

The problem here is that uint16.MAX isn't declared as a constant in the
VAPI, this is probably a bug.

Thank you for answering. So, I still have a few questions. Which is the
vapi, where it should be specified? Where do I report a Bug? Sorry, I'm a
Vala-newbe. ^^


My vala is expecting a ulong.
Also sizeof apparently isn't considered a constant in Vala. Which
means you cannot use const. This works for me:

ulong c = sizeof(int);

I'm sorry, but I don't understand. :( Should I generaly do not use
constants? How do I use them?

a sizeof expression isn't considered constant. I'm not sure whether this
is intentional or just a bug.





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