|
From: Steve L. <ste...@gm...> - 2005-09-06 09:52:16
|
On 9/4/05, Blake Winton <bw...@la...> wrote: > As I mentioned in a post to the Yahoo Group, I'm trying to compile > PalmCUnit with OnBoardC. I ran into a bug dealing with macros with > empty argument lists, and posted a pseudo-patch which should have dealt > with it. Thanks again for that, it's nice to have someone take the time to fix a problem for themself. > I worked around it for the time being by adding an ununsed dummy > argument, but now I'm running into another couple of missing features > which are totally blocking me. I'd suggest removing the parens from the macro definition if no arguments are intended. > The first is that pairs of string constants aren't concatenated, as per: > http://eli-project.sourceforge.net/c_html/c.html#s6.1.4 > ("Sequences of string literals are translated as single strings.") Hmm, yes, that needs fixing. > I can mostly work around this by merging the strings by hand, but it > presents a problem when we get to the second missing feature. The > preprocessor doesn't seem to implement the stringizing operator ("#"), > as described here: > http://msdn.microsoft.com/library/en-us/vclang/html/_predir_stringizing_o= perator.asp > or in section 6.10.3.2 of the ANSI C Standard at: > http://www.nirvani.net.nyud.net:8090/docs/ansi_c.pdf You're right, it doesn't. The preprocessor in OnBC is pretty minimal. It would be nice to add these features. Could you add them as feature requests on the sourceforge page, so we can keep track of them? http://sourceforge.net/tracker/?atid=3D478289&group_id=3D55794 > Is there anyone working on these, or can someone give me some hints as > to where in the code I would need to add these features? The preprocessor isn't actually implemented as a seperate stage from compiling/parsing, but is done as the parser goes over the code. As such, there's a few places worth looking at. For the first one (concatenating string constants), take a look at compile.c, ~line 3009. (Search for DoubleQuote), which is where quoted strings are handled. For the # preprocessor operator, you probably need to look at the macro argument expansion code, in OnBoardC.c (which you've already looked at it seems...) I'll try to take a look at these things unless you get to them first. Adding them to the sourceforge Tracker will ensure they don't get forgotten about, but I haven't had a lot of time for Palm work recently. Again, we'd love to have you on the team, if you're interested in helping out by contributing. Thanks, Boz |