|
From: Blake W. <bw...@la...> - 2005-09-05 22:10:37
|
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. 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. 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.") 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_operator.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 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? Thanks, Blake. |
|
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 |
|
From: Blake W. <bw...@la...> - 2005-09-06 13:20:57
|
> 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. Heh. That's what happens when my mailserver decides to stop working. But surely you see more of that than other open-source projects, what with all you users by definition knowing the language you used to write the code. :) > > 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. Well, yeah, I could do that, but I really want it to look like a function call. (It's the "FAIL()" pseudo-method in the Test Framework.) > 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=478289&group_id=55794 I will, but I might take a crack at them before I do. > 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...) Cool, I'll see what I can do in there, after I get it all set up. > Again, we'd love to have you on the team, if you're interested in > helping out by contributing. I'm glad to submit patches when I can, but please don't put me on the team. I'm already on six or seven teams that I only submitted a couple of patches to. ;) Ah, what the hell. Add me (I think I'm bwinton on sourceforge), and when the sourceforge site is back up, I'll add the feature requests, and assign them to myself. I can't promise that I'll have much time to work on OBC, at least until another problem bugs me, but it doesn't hurt to be on the list, right? What else would you need to know? My policy should be: I-abstain-unless-I-officially-vote and I promise to abide by the rest of the rules listed in section 3 of the Charter. Thanks, Blake. |
|
From: Steve L. <ste...@gm...> - 2005-09-06 13:51:09
|
On 9/6/05, Blake Winton <bw...@la...> wrote: > But surely you see more of that than other open-source projects, what > with all you users by definition knowing the language you used to write > the code. :) True, but alot are relatively new to C programming, and compilers can be a slightly intimidating area to play in... > > I'd suggest removing the parens from the macro definition if no > > arguments are intended. >=20 > Well, yeah, I could do that, but I really want it to look like a > function call. (It's the "FAIL()" pseudo-method in the Test Framework.) Fair enough. It's nice to be as compatible with other compilers as possible, so fixing this is a good step in the right direction. > > 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 >=20 > I will, but I might take a crack at them before I do. If you wouldn't mind, please add them even if you fix them. I also use those trackers to list the changes/fixes/improvements made since the last release, so it's nice to put things in, even if they get closed straight away. > > 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...) >=20 > Cool, I'll see what I can do in there, after I get it all set up. Great, thanks! If you have any problems getting set up, let me know and I'll try to help. Likewise if you have questions about the code itself. I didn't write most of it, but I'm pretty familiar with it. > > Again, we'd love to have you on the team, if you're interested in > > helping out by contributing. >=20 > I'm glad to submit patches when I can, but please don't put me on > the team. I'm already on six or seven teams that I only submitted > a couple of patches to. ;) >=20 > Ah, what the hell. Add me (I think I'm bwinton on sourceforge), and > when the sourceforge site is back up, I'll add the feature requests, > and assign them to myself. I can't promise that I'll have much time > to work on OBC, at least until another problem bugs me, but it doesn't > hurt to be on the list, right? Great. The email list is very low traffic normally (check the archive for an idea of how low it's been recently), and most people just contribute bits and pieces when they get time. Any and all help is appreciated. I'll go sign you up. Thanks again, Boz |