Closed KyleCardoza closed 1 year ago
The preprocessor macros you list are all supported. Is the reason you do not think they are supported because they are not mentioned in the User Guide?
Statement expressions are actually supported by the Clang front end (which I use), but they will currently cause an internal error. I have fixed this for the next release, so it will soon be supported.
Oh my. My bad. Yeah, I was going by the user guide, I should have thought to actually try it before asking. Apologies.
Thanks for the other bit, though, with the statement exprs.
No problem, I added a note to document them (and see if there are others like that) at some point.
Regarding statement expressions, I suspect inline functions can be used instead in some cases and they are standard C.
Absolutely true, and what I'm doing now -- but I've found statement expressions useful for making sure that a function-like macro always evaluates to an expression, rather than risk accidentally exploding a bunch of statements in the middle of an if conditional or the like.
Oh, quick question while I have you -- does Calypsi have GCC's __auto_type extension?
I checked the __typeof
extension and it did not work, I fixed it for the next release. __auto_type
also works now.
Interesting things, I did not know that feature existed, though it is an extension.
Very true, they're non-standard. They are very useful though. Thank you again for sticking that in there! There're other things I could ask for, but I think I'd be pressing my luck to bug you with them right now. You obviously work really hard on this thing, and I appreciate it greatly.
It would be useful to have preprocessor variables such as
__COUNTER__
(which resolves to a number that increments each time the variable is used),__FILE__
(expands to the filename),__LINE__
(expands to the line number), and__DATE__
&__TIME__
(pretty much what it says on the tin).It would also be very useful to be able to use GCC-style statement expressions, where a bracketed series of statements are surrounded in parentheses and usable as a single expression which resolves to the value of the last statement, as in
which would run the embedded code and resolve to the value of
z
without exposingy
to the namespace outside the brackets.