
Hello ! I've set up a branch of c2hs using Language.C's parser and pretty printer.
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small bonus, implements "enum define" hooks (Bug #5). best regards, benedikt

"Benedikt" == Benedikt Huber
writes:
Benedikt> Hello ! I've set up a branch of c2hs using Language.C's Benedikt> parser and pretty printer.
Benedikt> The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as Benedikt> a small bonus, implements "enum define" hooks (Bug #5). Thanks a lot. I already lost faith "enum define" hooks will be ever implemented :-) Any chance to incorporate it into mainstream? Sincerely, Gour -- Gour | Zagreb, Croatia | GPG key: C6E7162D ----------------------------------------------------------------

On Wed, 2008-08-20 at 20:49 +0200, Benedikt Huber wrote:
Hello !
I've set up a branch of c2hs using Language.C's parser and pretty printer.
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small bonus, implements "enum define" hooks (Bug #5).
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file. Can you think of any other good test cases to give us some confidence? I'd use gtk2hs but of course it is still using it's own c2hs fork. I did manage to test cairo as that's using the normal c2hs, at least with patches to cabalise it. That produced identical results (except for numbering C2HS_COND_SENTRY_'s from 0 rather than 1). So I'm inclined to just push this out at version 0.16.0 and invite testers. It'd be nice if our own test cases worked though. Duncan

On Sat, 2009-01-24 at 16:57 +0000, Duncan Coutts wrote:
On Wed, 2008-08-20 at 20:49 +0200, Benedikt Huber wrote:
Hello !
I've set up a branch of c2hs using Language.C's parser and pretty printer.
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small bonus, implements "enum define" hooks (Bug #5).
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file.
Can you think of any other good test cases to give us some confidence? I'd use gtk2hs but of course it is still using it's own c2hs fork.
I did manage to test cairo as that's using the normal c2hs, at least with patches to cabalise it. That produced identical results (except for numbering C2HS_COND_SENTRY_'s from 0 rather than 1).
The packages on Hackage that declare that they use c2hs also continue to work fine (there may be others that use it but do not declare the fact). So, Benedikt, you wrote all the new code for this release, what code name do you want to give it? :-) There have been some odd ones: 0.7.10 Afterthought 0.8.3 Gentle Moon 0.9.0 Blue Ginger 0.11.5 Powder Snow 0.10.17 Altocumulus Stratiformis Perlucidus Undulatus 0.12.0 Springtime 0.13.6 Pressing Forward 0.14.6 Travelling Lightly 0.15.0 Rainy Days I'll try and fix #11 while we're at it. Duncan

Duncan Coutts
There have been some odd ones: 0.7.10 Afterthought 0.8.3 Gentle Moon 0.9.0 Blue Ginger 0.11.5 Powder Snow 0.10.17 Altocumulus Stratiformis Perlucidus Undulatus 0.12.0 Springtime 0.13.6 Pressing Forward 0.14.6 Travelling Lightly 0.15.0 Rainy Days
0.16.0 Lingering Completion, in reference to Language.C? -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

Hello, Thanks for considering the patches ! On 24.01.2009, at 19:44, Duncan Coutts wrote:
On Sat, 2009-01-24 at 16:57 +0000, Duncan Coutts wrote:
On Wed, 2008-08-20 at 20:49 +0200, Benedikt Huber wrote:
Hello !
I've set up a branch of c2hs using Language.C's parser and pretty printer.
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small bonus, implements "enum define" hooks (Bug #5).
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file.
Strange, this test works on my system - there should be a file Capital.h, and in fact, all files should be named Capital.? (with capital C). I'm on a case-insensitive filesystem though (sigh), so maybe some darcs confusion.
Can you think of any other good test cases to give us some confidence? I'd use gtk2hs but of course it is still using it's own c2hs fork.
I did manage to test cairo as that's using the normal c2hs, at least with patches to cabalise it. That produced identical results (except for numbering C2HS_COND_SENTRY_'s from 0 rather than 1).
The packages on Hackage that declare that they use c2hs also continue to work fine (there may be others that use it but do not declare the fact).
Very good ! Could you please review (very small changes) and apply the following patches, too ? Just to ensure c2hs will work with the next release of language.c as well (stays compatible with 0.3.1).
So, Benedikt, you wrote all the new code for this release, what code name do you want to give it? :-)
There have been some odd ones: 0.7.10 Afterthought 0.8.3 Gentle Moon 0.9.0 Blue Ginger 0.11.5 Powder Snow 0.10.17 Altocumulus Stratiformis Perlucidus Undulatus 0.12.0 Springtime 0.13.6 Pressing Forward 0.14.6 Travelling Lightly 0.15.0 Rainy Days
On 24.01.2009, at 19:58, Achim Schneider wrote:
0.16.0 Lingering Completion, in reference to Language.C? Oh, very true and a nice pun, but maybe to obvious ?
I'd like to suggest 0.16.0 'Crystal Seed'. It contains a reference to the environment (it's freezing), C would have been called Crystal if invented after Perl and Ruby, and finally, the seed (the C parser) buried in c2hs made it into a library and back into c2hs again. Seriously ;) -- benedikt

On Sat, 2009-01-24 at 21:07 +0100, Benedikt Huber wrote:
Hello,
Thanks for considering the patches !
I've pushed them to the darcs repo along with the fix for #11.
On 24.01.2009, at 19:44, Duncan Coutts wrote:
On Sat, 2009-01-24 at 16:57 +0000, Duncan Coutts wrote:
On Wed, 2008-08-20 at 20:49 +0200, Benedikt Huber wrote:
Hello !
I've set up a branch of c2hs using Language.C's parser and pretty printer.
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small bonus, implements "enum define" hooks (Bug #5).
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file.
Strange, this test works on my system - there should be a file Capital.h, and in fact, all files should be named Capital.? (with capital C).
Capital.c and Capital.chs both #include "capital.h" Changing both to #include "Capital.h" makes the test work.
I'm on a case-insensitive filesystem though (sigh), so maybe some darcs confusion.
Ah, that'd explain things. On that topic, Achim has noticed that c2hs currently converts names like AG_FunctionFoo into functionfoo rather than functionFoo. I sent another email about that. If you had a moment to check that over I'd very much appreciate it.
Could you please review (very small changes) and apply the following patches, too ? Just to ensure c2hs will work with the next release of language.c as well (stays compatible with 0.3.1).
Ah, sorry, they depend on the patch: Fri Aug 15 20:09:07 BST 2008 benedikt.huber@gmail.com * Version.hs: add note that this is a patched version using Language.C which I did not apply since it didn't make sense for the mainline version. Would you mind re-sending the patches after pulling the latest patches from the mainline c2hs repo? As for the content of the patches it looks fine. What happened to CAsmExt?
On 24.01.2009, at 19:58, Achim Schneider wrote:
0.16.0 Lingering Completion, in reference to Language.C? Oh, very true and a nice pun, but maybe to obvious ?
I'd like to suggest 0.16.0 'Crystal Seed'. It contains a reference to the environment (it's freezing), C would have been called Crystal if invented after Perl and Ruby, and finally, the seed (the C parser) buried in c2hs made it into a library and back into c2hs again. Seriously ;)
Done! Yes it's nice to finally get the C parser back again :-). BTW, I can't help flinching at names like CDeclExt, CThis, CThat etc (yes I know they were that way in c2hs originally). Next time you make an API break would you consider using names designed for qualified import? like C.DeclExt etc? Duncan

On 24.01.2009, at 21:56, Duncan Coutts wrote:
Capital.c and Capital.chs both #include "capital.h"
Changing both to #include "Capital.h" makes the test work.
I'm on a case-insensitive filesystem though (sigh), so maybe some darcs confusion.
Ah, that'd explain things. I should switch to a case-sensitive system for testing, really.
Could you please review (very small changes) and apply the following patches, too ? Just to ensure c2hs will work with the next release of language.c as well (stays compatible with 0.3.1).
Ah, sorry, they depend on the patch:
Fri Aug 15 20:09:07 BST 2008 benedikt.huber@gmail.com * Version.hs: add note that this is a patched version using Language.C
which I did not apply since it didn't make sense for the mainline version.
Would you mind re-sending the patches after pulling the latest patches from the mainline c2hs repo?
This patch also contains the missing files for the system tests.
As for the content of the patches it looks fine. What happened to CAsmExt? Oh, the arity of the constructor changes from 1 to 2. In language- c-0.3.1, CAsmExt doesn't carry any information.
Yes it's nice to finally get the C parser back again :-).
BTW, I can't help flinching at names like CDeclExt, CThis, CThat etc (yes I know they were that way in c2hs originally). Next time you make an API break would you consider using names designed for qualified import? like C.DeclExt etc?
Usually I prefer qualified import too, and yes, this should be considered. But probably not before the analysis module is a little bit more stable. benedikt

On Sun, 2009-01-25 at 00:32 +0100, Benedikt Huber wrote:
Would you mind re-sending the patches after pulling the latest patches from the mainline c2hs repo?
This patch also contains the missing files for the system tests.
Applied thanks.
BTW, I can't help flinching at names like CDeclExt, CThis, CThat etc (yes I know they were that way in c2hs originally). Next time you make an API break would you consider using names designed for qualified import? like C.DeclExt etc?
Usually I prefer qualified import too, and yes, this should be considered. But probably not before the analysis module is a little bit more stable.
I don't mind when :-). Let me know if/when it changes and I'll be happy to patch c2hs to use the different names. Duncan

Duncan Coutts:
On Sat, 2009-01-24 at 21:07 +0100, Benedikt Huber wrote:
I'd like to suggest 0.16.0 'Crystal Seed'. It contains a reference to the environment (it's freezing), C would have been called Crystal if invented after Perl and Ruby, and finally, the seed (the C parser) buried in c2hs made it into a library and back into c2hs again. Seriously ;)
Done!
Yes it's nice to finally get the C parser back again :-).
Absolutely - great stuff!! Manuel

On 24.01.2009, at 19:44, Duncan Coutts wrote:
On Sat, 2009-01-24 at 16:57 +0000, Duncan Coutts wrote:
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file. Update: As I said, the call_capital test works for me, but there seem to be some files missing in tests/system:
Running the tests, all succeed but one on my system:
---=== Output for `sizeof': sizeof: Fatal: sizeof s3 != size_of_s3(): 10 but expected 12 !!! sizeof FAILED: Maybe related to bug #10
typedef struct s3 { struct { int a : BFSZ(int,13); int b : BFSZ(int,13); int b_1: BFSZ(int,13); int b_2: BFSZ(int,13); int b_3: BFSZ(int,13); } f0;
This "bug" was also present in the last version of c2hs, though, so no regression. -- benedikt

On Sat, 2009-01-24 at 21:38 +0100, Benedikt Huber wrote:
On 24.01.2009, at 19:44, Duncan Coutts wrote:
On Sat, 2009-01-24 at 16:57 +0000, Duncan Coutts wrote:
I've pulled the changes and I'm just trying to get some tests running. You added ./tests/bugs/call_capital/ but I can't seem to make it work. It's looking for a "capital.h" but there's no such file.
Update: As I said, the call_capital test works for me,
Yep, fixed that one. Just a case sensitive file system issue.
but there seem to be some files missing in tests/system:
I seem to be missing at least structs.expect I've also got no sizeof files but the makefile mentions them. Do you have either?
Running the tests, all succeed but one on my system:
---=== Output for `sizeof': sizeof: Fatal: sizeof s3 != size_of_s3(): 10 but expected 12 !!! sizeof FAILED: Maybe related to bug #10
typedef struct s3 { struct { int a : BFSZ(int,13); int b : BFSZ(int,13); int b_1: BFSZ(int,13); int b_2: BFSZ(int,13); int b_3: BFSZ(int,13); } f0;
This "bug" was also present in the last version of c2hs, though, so no regression.
Ah, does that mean you do have the sizeof files? Duncan
participants (5)
-
Achim Schneider
-
Benedikt Huber
-
Duncan Coutts
-
Gour
-
Manuel M T Chakravarty