"ro********@gmail.com" <ro********@gmail.comwrote:
# typeof(var) returns data type of the var
# so can we have something like this..
#
#
# #define typestring(X) #X
#defines and all that occur prior to parsing.
# char *type = typestring(typeof(a));
The typeof can only makes sense as the context
sensitive parsing occurs.
# but this is not working...
# macro returns string typeof(a) ..
Because typeof(a) could not be evaluated during preprocessing.
This is why _function_ is character string variable, not a #define.
It requires information from the parser not available to the
preprocessor.
# i want to pass result of typeof(a) to the macro
# how can we do that?
You're screwed. Sorry. You need a parser that is willing to
share this information; except gnu objective-c, I don't know
any other parser that does this. I don't know of any parser
that even generates old-fashionned cross-reference output
that you could use for this.
The parser obviously has this information available, and if made
available would solve var-args induced bugs, but it simply isn't
done. (Historical inertia?)
--
SM Ryan
http://www.rawbw.com/~wyrmwif/
What kind of convenience store do you run here?