From haskell.vivian.mcphail at gmail.com Sat Apr 7 06:48:23 2007 From: haskell.vivian.mcphail at gmail.com (Alexander McPhail) Date: Sat Apr 7 06:47:03 2007 Subject: [C2hs] Building Projects under mingw that use c2hs Message-ID: <7b03b3c60704070348i6a03040co2498764e03c2fd66@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: mingw-c2hs-cabal-test.zip Type: application/zip Size: 9471 bytes Desc: not available Url : http://www.haskell.org/pipermail/c2hs/attachments/20070407/812af241/mingw-c2hs-cabal-test.zip From haskell.vivian.mcphail at gmail.com Sat Apr 7 09:45:20 2007 From: haskell.vivian.mcphail at gmail.com (Alexander McPhail) Date: Sat Apr 7 09:43:58 2007 Subject: [C2hs] Building Projects under mingw that use c2hs [apologies for repost; archive seemed to scrub text portion, see archive for attached file] Message-ID: <7b03b3c60704070645m6406a5f9ief36d74d610f994@mail.gmail.com> Hi, I have been trying to build a Cabal package that uses c2hs under mingw and have run into some problems. 1) c2hs needed its own options because it has to pass a flag to its invocation of the CPP. I have already submitted this patch. (I also noticed a request for cppOptions in the Cabal.cabal file, so I added that) 2) When c2hs generates the foreign import ccall unsafe "path/to/include.h function" :: Type it doesn't insert the appropriate number of path separators for windows ( i.e. \\ not \) I have this patch sitting in my copy of c2hs. But what I did is really ugly: at around line 567 (process :: FilePath -> FilePath -> CST s ()) I inserted: > outFName' <- getSwitch outputSB > -- on windows the path separator needs to be "\\" not "\" > let outFName = replaceFileSeparator outFName' where replaceFileSeparator is defined as: > replaceFileSeparator :: String -> String > replaceFileSeparator [] = [] > replaceFileSeparator (x:xs) > | x == '\\' = "\\\\" ++ (replaceFileSeparator xs) > | otherwise = x : (replaceFileSeparator xs) this fixes the problem but stinks. 3) when compiling my c2hs generated .hs file, the c2hs generated .h file is not being found. $ ./Setup.lhs -v build Reading parameters from D:\Apps\MSYS\1.0\local\src\mingw-c2hs-cabal-test\cabal-root\mingw- c2hs-cabal-test.buildinfo Preprocessing library Mingw-c2hs-cabal-test-0.0.1... D:\Apps\MSYS\1.0\local\bin\c2hs.exe -C -D__GLASGOW_HASKELL__=606 -C -I..\include --cppopts=-I../include --include=src -o src\Cabal\MingwTest.hs src\Cabal\MingwTest.chs D:\Apps\MSYS\1.0\local\bin\c2hs.exe -C -D__GLASGOW_HASKELL__=606 -C -I..\include --cppopts=-I../include --include=src -o src\Cabal\MingwTest2.hs src\Cabal\MingwTest2.chs Building Mingw-c2hs-cabal-test-0.0.1... d:\Apps\ghc\ghc- 6.6\bin\ghc.exe -package-name Mingw-c2hs-cabal-test-0.0.1--make -hide-all-packages -i -idist\build\autogen -i. -isrc -I..\include -#include "test.h" -odir dist\build -hidir dist\build -package base-2.0 -O -package haskell98 -fglasgow-exts -fffi Cabal.MingwTest Cabal.MingwTest2C2HS [1 of 3] Compiling C2HS ( src/C2HS.hs, dist\build/C2HS.o ) [2 of 3] Compiling Cabal.MingwTest ( src/Cabal/MingwTest.hs, dist\build/Cabal/MingwTest.o ) C:\DOCUME~1\vivian\LOCALS~1\Temp\ghc31772_0\ghc31772_0.hc:6:33: src\Cabal\MingwTest.h: No such file or directory I have attached a set of files that will generate the errors I have mentioned on mingw. Cheers, Vivian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/c2hs/attachments/20070408/3e6a15e8/attachment-0001.htm From duncan.coutts at worc.ox.ac.uk Thu Apr 12 01:41:47 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 01:40:24 2007 Subject: [C2hs] Re: [Haskell-cafe] c2hs on mac In-Reply-To: <3872CA91-8D53-41D1-9B71-DB5F00DDF195@student.unsw.edu.au> References: <3872CA91-8D53-41D1-9B71-DB5F00DDF195@student.unsw.edu.au> Message-ID: <1176356507.5005.101.camel@localhost> On Thu, 2007-04-12 at 15:20 +1000, Ruben Zilibowitz wrote: > Hi, > > I am having trouble building c2hs on Mac OS X. I noticed that > Darwinports has a port for this, but I'd like to install it without > using Darwinports because I already have ghc compiled and installed > on my system. > > Does anyone know how to get c2hs to work on the mac (or why it > doesn't work in the first place)? What is the problem exactly? Are you using the latest tarball or the darcs version? Duncan From duncan.coutts at worc.ox.ac.uk Thu Apr 12 03:19:00 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 03:17:28 2007 Subject: [C2hs] patch applied (c2hs): TAG C parser cleanups checkpoint Message-ID: <20070412071900.GA25847@cvs.haskell.org> Thu Apr 12 00:17:43 PDT 2007 Duncan Coutts tagged C parser cleanups checkpoint From duncan.coutts at worc.ox.ac.uk Thu Apr 12 19:01:43 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 19:00:20 2007 Subject: [C2hs] Re: [Haskell-cafe] more problems with c2hs In-Reply-To: References: Message-ID: <1176418904.5005.119.camel@localhost> On Fri, 2007-04-13 at 02:37 +1000, Ruben Zilibowitz wrote: > Hi, > > I've built and installed c2hs on my Mac OS X system now. I read > through the research paper on c2hs available on the website for c2hs > and decided I would need to try it out to learn it. But it gives me > errors which I am having trouble trying to understand. Here are the > error messages: > > c2hs file.chs > > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input > file has no effect > powerpc-apple-darwin8-gcc-4.0.1: no input files > c2hs: Error during preprocessing custom header file c2hs runs cpp -x c ${header} for the header file you specify. You can either specify a header file on the commend line or use #include's in the .chs file. c2hs should generate a .h file itself in that case but it looks like it isn't for some reason. You can find out what it is really doing by running: c2hs --dump trace file.chs btw, the better mailing list for this stuff is the c2hs mailing list: c2hs@haskell.org Duncan From rubenz at cse.unsw.edu.au Thu Apr 12 19:49:33 2007 From: rubenz at cse.unsw.edu.au (Ruben Zilibowitz) Date: Thu Apr 12 19:47:58 2007 Subject: [C2hs] Re: [Haskell-cafe] more problems with c2hs In-Reply-To: <1176418904.5005.119.camel@localhost> References: <1176418904.5005.119.camel@localhost> Message-ID: Thanks for pointing to the appropriate mailing list. This is what appears to be happening. file.chs has a line: #include "file.h" After running: c2hs file.chs file.h gets modified so that it contains just: #include "file.h" So I lose the contents of file.h every time I run c2hs! Running cpp - x c file.h by itself doesn't have that effect so the problem must be caused by c2hs somehow. What is wrong with my c2hs? Perhaps the darcs version has some bugs in it. Ruben On 13/04/2007, at 9:01 AM, Duncan Coutts wrote: > On Fri, 2007-04-13 at 02:37 +1000, Ruben Zilibowitz wrote: >> Hi, >> >> I've built and installed c2hs on my Mac OS X system now. I read >> through the research paper on c2hs available on the website for c2hs >> and decided I would need to try it out to learn it. But it gives me >> errors which I am having trouble trying to understand. Here are the >> error messages: >> >> c2hs file.chs >> >> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory >> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory >> powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input >> file has no effect >> powerpc-apple-darwin8-gcc-4.0.1: no input files >> c2hs: Error during preprocessing custom header file > > c2hs runs cpp -x c ${header} > > for the header file you specify. You can either specify a header > file on > the commend line or use #include's in the .chs file. c2hs should > generate a .h file itself in that case but it looks like it isn't for > some reason. You can find out what it is really doing by running: > > c2hs --dump trace file.chs > > btw, the better mailing list for this stuff is the c2hs mailing list: > c2hs@haskell.org > > Duncan > From duncan.coutts at worc.ox.ac.uk Thu Apr 12 20:04:04 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 20:02:41 2007 Subject: [C2hs] Re: [Haskell-cafe] more problems with c2hs In-Reply-To: References: <1176418904.5005.119.camel@localhost> Message-ID: <1176422645.5005.128.camel@localhost> On Fri, 2007-04-13 at 09:49 +1000, Ruben Zilibowitz wrote: > Thanks for pointing to the appropriate mailing list. This is what > appears to be happening. > file.chs has a line: #include "file.h" > After running: > c2hs file.chs > file.h gets modified so that it contains just: > #include "file.h" > > So I lose the contents of file.h every time I run c2hs! Yes, this file is generated by c2hs from the things you put in the .chs file (like #include and other cpp stuff, #if and the like). So you can't modify that .h file yourself. Also, you cannot #include "file.h" inside "file.chs" because that'll generate a "file.h" file that recursively #includes itself! Personally, I think it's very bad behaviour that the file is called the same as the .chs file but with a .h extension, since this is exactly the name of a file that many people will want to include. I intend to change it to use file.chs.h or something similar that will not clash. (Also I'd like to not generate any .chs.h file in the common case of just #including a single .h file.) Duncan From rubenz at cse.unsw.edu.au Thu Apr 12 20:17:53 2007 From: rubenz at cse.unsw.edu.au (Ruben Zilibowitz) Date: Thu Apr 12 20:16:18 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <1176422645.5005.128.camel@localhost> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> Message-ID: <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> Oh, right. I see now. I have renamed file.chs to fileInterface.chs. And left the line #include "file.h" in there. But c2hs fileInterface.chs still gives me errors: Attempting to read file `fileInterface.chs'... ...parsing `fileInterface'... ...successfully loaded `fileInterface'. Invoking cpp as `cpp -x c fileInterface.h > fileInterface.i'... powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input file has no effect powerpc-apple-darwin8-gcc-4.0.1: no input files c2hs: Error during preprocessing custom header file It seems that cpp isn't happy with: cpp -x c fileInterface.h. It complains about the -x c option. Perhaps this is a bug in the Mac OS X version of cpp. Any ideas? Ruben On 13/04/2007, at 10:04 AM, Duncan Coutts wrote: > On Fri, 2007-04-13 at 09:49 +1000, Ruben Zilibowitz wrote: >> Thanks for pointing to the appropriate mailing list. This is what >> appears to be happening. >> file.chs has a line: #include "file.h" >> After running: >> c2hs file.chs >> file.h gets modified so that it contains just: >> #include "file.h" >> >> So I lose the contents of file.h every time I run c2hs! > > Yes, this file is generated by c2hs from the things you put in > the .chs > file (like #include and other cpp stuff, #if and the like). > > So you can't modify that .h file yourself. Also, you cannot #include > "file.h" inside "file.chs" because that'll generate a "file.h" file > that > recursively #includes itself! > > Personally, I think it's very bad behaviour that the file is called > the > same as the .chs file but with a .h extension, since this is > exactly the > name of a file that many people will want to include. I intend to > change > it to use file.chs.h or something similar that will not clash. > (Also I'd > like to not generate any .chs.h file in the common case of just > #including a single .h file.) > > Duncan > From duncan.coutts at worc.ox.ac.uk Thu Apr 12 20:40:38 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 20:39:12 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> Message-ID: <1176424838.7971.2.camel@localhost> On Fri, 2007-04-13 at 10:17 +1000, Ruben Zilibowitz wrote: > Oh, right. I see now. I have renamed file.chs to fileInterface.chs. > And left the line #include "file.h" in there. But c2hs > fileInterface.chs still gives me errors: > > Attempting to read file `fileInterface.chs'... > ...parsing `fileInterface'... > ...successfully loaded `fileInterface'. > Invoking cpp as `cpp -x c fileInterface.h > fileInterface.i'... > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input > file has no effect > powerpc-apple-darwin8-gcc-4.0.1: no input files > c2hs: Error during preprocessing custom header file > > It seems that cpp isn't happy with: cpp -x c fileInterface.h. It > complains about the -x c option. Perhaps this is a bug in the Mac OS > X version of cpp. Any ideas? Ok, try these from the command line and tell us which work: 1. cpp -x -c fileInterface.h > fileInterface.i 2. cpp -x -c fileInterface.h -o fileInterface.i 3. cpp fileInterface.h -x -c > fileInterface.i 4. cpp fileInterface.h > fileInterface.i 5. gcc -x -c -E fileInterface.h > fileInterface.i 6. gcc -E fileInterface.h > fileInterface.i Perhaps also look in the cpp man page to see if there is anything funny about the -x option on OSX. The reason we need the -x c is to tell cpp that this file is a c file despite the fact that it ends in .h. The same applies to gcc -E. For example if you find gcc -E -x -c works then you can use that: c2hs --cpp='gcc -E' file.chs Duncan From rubenz at cse.unsw.edu.au Thu Apr 12 21:09:27 2007 From: rubenz at cse.unsw.edu.au (Ruben Zilibowitz) Date: Thu Apr 12 21:07:49 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <1176424838.7971.2.camel@localhost> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> <1176424838.7971.2.camel@localhost> Message-ID: <2A644047-0D53-4926-B387-305849EFCE52@cse.unsw.edu.au> All these seemed to work except for 2. In the c2hs output it says: cpp -x c ... not: cpp -x -c ... I think that might be a key issue. Ruben On 13/04/2007, at 10:40 AM, Duncan Coutts wrote: > On Fri, 2007-04-13 at 10:17 +1000, Ruben Zilibowitz wrote: >> Oh, right. I see now. I have renamed file.chs to fileInterface.chs. >> And left the line #include "file.h" in there. But c2hs >> fileInterface.chs still gives me errors: >> >> Attempting to read file `fileInterface.chs'... >> ...parsing `fileInterface'... >> ...successfully loaded `fileInterface'. >> Invoking cpp as `cpp -x c fileInterface.h > fileInterface.i'... >> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory >> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory >> powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input >> file has no effect >> powerpc-apple-darwin8-gcc-4.0.1: no input files >> c2hs: Error during preprocessing custom header file >> >> It seems that cpp isn't happy with: cpp -x c fileInterface.h. It >> complains about the -x c option. Perhaps this is a bug in the Mac OS >> X version of cpp. Any ideas? > > Ok, try these from the command line and tell us which work: > > 1. cpp -x -c fileInterface.h > fileInterface.i > > 2. cpp -x -c fileInterface.h -o fileInterface.i > > 3. cpp fileInterface.h -x -c > fileInterface.i > > 4. cpp fileInterface.h > fileInterface.i > > 5. gcc -x -c -E fileInterface.h > fileInterface.i > > 6. gcc -E fileInterface.h > fileInterface.i > > Perhaps also look in the cpp man page to see if there is anything > funny > about the -x option on OSX. > > The reason we need the -x c is to tell cpp that this file is a c file > despite the fact that it ends in .h. The same applies to gcc -E. > > For example if you find gcc -E -x -c works then you can use that: > c2hs --cpp='gcc -E' file.chs > > Duncan > From duncan.coutts at worc.ox.ac.uk Thu Apr 12 22:01:56 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 12 22:00:30 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <2A644047-0D53-4926-B387-305849EFCE52@cse.unsw.edu.au> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> <1176424838.7971.2.camel@localhost> <2A644047-0D53-4926-B387-305849EFCE52@cse.unsw.edu.au> Message-ID: <1176429716.7971.11.camel@localhost> On Fri, 2007-04-13 at 11:09 +1000, Ruben Zilibowitz wrote: > All these seemed to work except for 2. In the c2hs output it says: > cpp -x c ... > not: > cpp -x -c ... > I think that might be a key issue. Doh! That was my mistake. :-) It really should be "-x c" not "-x -c". The latter means something totally different :-) Sorry, could you try again with my mistake corrected. Here's an excerpt from the cpp man page on my system: -x c -x c++ -x objective-c -x assembler-with-cpp Specify the source language: C, C++, Objective-C, or assembly. This has nothing to do with standards conformance or extensions; it merely selects which base syntax to expect. If you give none of these options, cpp will deduce the language from the extension of the source file: .c, .cc, .m, or .S. Some other common extensions for C++ and assembly are also recognized. If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode. I thought this -x c feature was portable, where as relying on cpp to default to C mode for a .h file seems much less so. Perhaps we should just spit out a .c file instead of a .h file. It wouldn't make much difference to c2hs as far as I can see. Duncan From rubenz at cse.unsw.edu.au Thu Apr 12 22:42:56 2007 From: rubenz at cse.unsw.edu.au (Ruben Zilibowitz) Date: Thu Apr 12 22:41:23 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <1176429716.7971.11.camel@localhost> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> <1176424838.7971.2.camel@localhost> <2A644047-0D53-4926-B387-305849EFCE52@cse.unsw.edu.au> <1176429716.7971.11.camel@localhost> Message-ID: <78BB9F4A-25FE-41E1-B2CA-8FADDA980524@cse.unsw.edu.au> I tried all the cpp commands you gave me with -x c instead of -x -c and none of them worked except for the one which had no -x c. It seems like a bug with cpp on Mac OS X. The man page also has the bit you quoted on my system too. Might ask about it on one of the apple mailing lists. Ruben On 13/04/2007, at 12:01 PM, Duncan Coutts wrote: > On Fri, 2007-04-13 at 11:09 +1000, Ruben Zilibowitz wrote: >> All these seemed to work except for 2. In the c2hs output it says: >> cpp -x c ... >> not: >> cpp -x -c ... >> I think that might be a key issue. > > Doh! That was my mistake. :-) It really should be "-x c" not "-x -c". > The latter means something totally different :-) > > Sorry, could you try again with my mistake corrected. > > Here's an excerpt from the cpp man page on my system: > > -x c > -x c++ > -x objective-c > -x assembler-with-cpp > Specify the source language: C, C++, Objective-C, or > assembly. This has nothing to do with standards > conformance or extensions; it merely selects which > base > syntax to expect. If you give none of these options, > cpp will deduce the language from the extension of the > source file: .c, .cc, .m, or .S. Some other common > extensions for C++ and assembly are also > recognized. If > cpp does not recognize the extension, it will treat > the > file as C; this is the most generic mode. > > I thought this -x c feature was portable, where as relying on cpp to > default to C mode for a .h file seems much less so. Perhaps we should > just spit out a .c file instead of a .h file. It wouldn't make much > difference to c2hs as far as I can see. > > Duncan > From duncan.coutts at worc.ox.ac.uk Thu Apr 12 19:01:43 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Fri Apr 13 14:42:27 2007 Subject: [C2hs] Re: [Haskell-cafe] more problems with c2hs In-Reply-To: References: Message-ID: <1176418904.5005.119.camel@localhost> On Fri, 2007-04-13 at 02:37 +1000, Ruben Zilibowitz wrote: > Hi, > > I've built and installed c2hs on my Mac OS X system now. I read > through the research paper on c2hs available on the website for c2hs > and decided I would need to try it out to learn it. But it gives me > errors which I am having trouble trying to understand. Here are the > error messages: > > c2hs file.chs > > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory > powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input > file has no effect > powerpc-apple-darwin8-gcc-4.0.1: no input files > c2hs: Error during preprocessing custom header file c2hs runs cpp -x c ${header} for the header file you specify. You can either specify a header file on the commend line or use #include's in the .chs file. c2hs should generate a .h file itself in that case but it looks like it isn't for some reason. You can find out what it is really doing by running: c2hs --dump trace file.chs btw, the better mailing list for this stuff is the c2hs mailing list: c2hs@haskell.org Duncan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe From rubenz at cse.unsw.edu.au Fri Apr 13 17:55:12 2007 From: rubenz at cse.unsw.edu.au (Ruben Zilibowitz) Date: Fri Apr 13 17:53:36 2007 Subject: [C2hs] more problems with c2hs In-Reply-To: <1176429716.7971.11.camel@localhost> References: <1176418904.5005.119.camel@localhost> <1176422645.5005.128.camel@localhost> <10FF5355-E302-411E-A808-686217ECA050@cse.unsw.edu.au> <1176424838.7971.2.camel@localhost> <2A644047-0D53-4926-B387-305849EFCE52@cse.unsw.edu.au> <1176429716.7971.11.camel@localhost> Message-ID: <2FF60447-1980-475F-8634-85F34E564FBE@cse.unsw.edu.au> This seems to work on my system: gcc -E -x c myheader.h An odd thing I noticed about cpp is that it appears to be a wrapper for gcc on Darwin: cpp --version powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Ruben On 13/04/2007, at 12:01 PM, Duncan Coutts wrote: > On Fri, 2007-04-13 at 11:09 +1000, Ruben Zilibowitz wrote: >> All these seemed to work except for 2. In the c2hs output it says: >> cpp -x c ... >> not: >> cpp -x -c ... >> I think that might be a key issue. > > Doh! That was my mistake. :-) It really should be "-x c" not "-x -c". > The latter means something totally different :-) > > Sorry, could you try again with my mistake corrected. > > Here's an excerpt from the cpp man page on my system: > > -x c > -x c++ > -x objective-c > -x assembler-with-cpp > Specify the source language: C, C++, Objective-C, or > assembly. This has nothing to do with standards > conformance or extensions; it merely selects which > base > syntax to expect. If you give none of these options, > cpp will deduce the language from the extension of the > source file: .c, .cc, .m, or .S. Some other common > extensions for C++ and assembly are also > recognized. If > cpp does not recognize the extension, it will treat > the > file as C; this is the most generic mode. > > I thought this -x c feature was portable, where as relying on cpp to > default to C mode for a .h file seems much less so. Perhaps we should > just spit out a .c file instead of a .h file. It wouldn't make much > difference to c2hs as far as I can see. > > Duncan > From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:31 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:45 2007 Subject: [C2hs] patch applied (c2hs): Deal with the scope of the ' for' loop' s decl properly Message-ID: <20070415103431.GA30386@cvs.haskell.org> Sun Apr 15 00:13:42 PDT 2007 Duncan Coutts * Deal with the scope of the 'for' loop's decl properly typedef int n; // n declared as a type name for (int n = ...; ...; ...) stmt; // n now considered a normal ident n n = 0; // n reverts to being a type name the declaration can define a local var (eg 'n') that masks a type of the same name from an outer scope. The local var goes out of scope at the end of the for loop's statement, if we don't do this then we treat 'n' as a normal ident rather than a typeident after the 'for' statement. M ./c2hs/c/CParser.y -2 +2 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:33 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:46 2007 Subject: [C2hs] patch applied (c2hs): Allow nested function definitions (a GNU C extension) Message-ID: <20070415103433.GA30406@cvs.haskell.org> Sun Apr 15 00:48:20 PDT 2007 Duncan Coutts * Allow nested function definitions (a GNU C extension) Just extends the things can can appear in compound statements, as well as statements and declarations we can have function definitions This GNU C extension is quite rarely used. M ./c2hs/c/CAST.hs -7 +22 M ./c2hs/c/CParser.y -9 +31 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:34 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:47 2007 Subject: [C2hs] patch applied (c2hs): Allow all unnamed struct members, not just unamed nested structs Message-ID: <20070415103434.GA30421@cvs.haskell.org> Sun Apr 15 00:54:06 PDT 2007 Duncan Coutts * Allow all unnamed struct members, not just unamed nested structs This does make the grammar too liberal but it's much easier to parse this more general grammar than trying to select just the unnamed nested structs. Unnamed members other than structs/unions can be checked in the AST later. It worked before, but once we introduce GNU C attributes it becomes virtually impossible to parse unambigiously. M ./c2hs/c/CParser.y -15 +7 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:35 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:49 2007 Subject: [C2hs] patch applied (c2hs): Apparently ' \f' and ' \v' are allowed in C strings and char literals Message-ID: <20070415103435.GA30436@cvs.haskell.org> Sun Apr 15 00:58:32 PDT 2007 Duncan Coutts * Apparently '\f' and '\v' are allowed in C strings and char literals According to both gcc and the C99 spec. Some odd programs really use it too, like flex and binutils. M ./c2hs/c/CLexer.x -2 +2 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:37 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:51 2007 Subject: [C2hs] patch applied (c2hs): Rename terminal ' extension' to ' __extension__' Message-ID: <20070415103437.GA30450@cvs.haskell.org> Sun Apr 15 03:14:27 PDT 2007 Duncan Coutts * Rename terminal 'extension' to '__extension__' That's what's it's really called anyway. M ./c2hs/c/CParser.y -8 +8 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:38 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:51 2007 Subject: [C2hs] patch applied (c2hs): Shorten names of the GNU C __attribute__ non-terminals Message-ID: <20070415103438.GA30464@cvs.haskell.org> Sun Apr 15 03:15:45 PDT 2007 Duncan Coutts * Shorten names of the GNU C __attribute__ non-terminals Since we're going to be sprinkling them round the rest of the grammar it's nicer if they don't have such huge names. Also uncomment those non-terminals. M ./c2hs/c/CParser.y -22 +22 From duncan.coutts at worc.ox.ac.uk Sun Apr 15 06:34:39 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Apr 15 06:32:53 2007 Subject: [C2hs] patch applied (c2hs): Rename maybe_asm -> asm_opt for naming consistency Message-ID: <20070415103439.GA30479@cvs.haskell.org> Sun Apr 15 03:18:38 PDT 2007 Duncan Coutts * Rename maybe_asm -> asm_opt for naming consistency M ./c2hs/c/CParser.y -4 +4 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:05 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:05 2007 Subject: [C2hs] patch applied (c2hs): Allow attrs in decl qualifier/specifiers and after declarators. Message-ID: <20070419122805.GA908@cvs.haskell.org> Thu Apr 19 04:58:14 PDT 2007 Duncan Coutts * Allow attrs in decl qualifier/specifiers and after declarators. This is the most common case. Note the lexer still doesn't pass attribute tokens through. M ./c2hs/c/CParser.y -14 +36 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:07 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:08 2007 Subject: [C2hs] patch applied (c2hs): Allow attrs in most places in declarators Message-ID: <20070419122807.GA928@cvs.haskell.org> Thu Apr 19 05:05:42 PDT 2007 Duncan Coutts * Allow attrs in most places in declarators in (..) parenthesis and after '*' pointers. M ./c2hs/c/CParser.y -3 +53 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:08 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:08 2007 Subject: [C2hs] patch applied (c2hs): Allow attrs before top level and nested declarations and type names Message-ID: <20070419122808.GA943@cvs.haskell.org> Thu Apr 19 05:07:57 PDT 2007 Duncan Coutts * Allow attrs before top level and nested declarations and type names M ./c2hs/c/CParser.y -13 +15 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:09 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:10 2007 Subject: [C2hs] patch applied (c2hs): Allow attributes within struct declaring lists Message-ID: <20070419122809.GA957@cvs.haskell.org> Thu Apr 19 05:09:47 PDT 2007 Duncan Coutts * Allow attributes within struct declaring lists Before, after and between each struct declarator. M ./c2hs/c/CParser.y -10 +10 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:11 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:11 2007 Subject: [C2hs] patch applied (c2hs): Allow attributes in parameter lists Message-ID: <20070419122811.GA971@cvs.haskell.org> Thu Apr 19 05:12:03 PDT 2007 Duncan Coutts * Allow attributes in parameter lists Before, after and between each parameter declaration. M ./c2hs/c/CParser.y -8 +9 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:12 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:12 2007 Subject: [C2hs] patch applied (c2hs): Allow attributes within enum, struct and union declarations Message-ID: <20070419122812.GA985@cvs.haskell.org> Thu Apr 19 05:13:52 PDT 2007 Duncan Coutts * Allow attributes within enum, struct and union declarations eg: enum __attribute__ ((...)) { ... } M ./c2hs/c/CParser.y -16 +16 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:13 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:16 2007 Subject: [C2hs] patch applied (c2hs): Allow attributes after labels Message-ID: <20070419122813.GA1000@cvs.haskell.org> Thu Apr 19 05:15:06 PDT 2007 Duncan Coutts * Allow attributes after labels M ./c2hs/c/CParser.y -1 +1 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:15 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:17 2007 Subject: [C2hs] patch applied (c2hs): Don' t ignore attributes in the lexer anymore Message-ID: <20070419122815.GA1015@cvs.haskell.org> Thu Apr 19 05:19:28 PDT 2007 Duncan Coutts * Don't ignore attributes in the lexer anymore So now we find out if the parser really can handle __attributes__ in all the right places. It should do. I can still parse the kernel and all the core system packages on my system. M ./c2hs/c/CLexer.x -4 +4 From duncan.coutts at worc.ox.ac.uk Thu Apr 19 08:28:16 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Apr 19 08:26:17 2007 Subject: [C2hs] patch applied (c2hs): Add a bunch of my parser test progs Message-ID: <20070419122816.GA1031@cvs.haskell.org> Thu Apr 19 05:23:17 PDT 2007 Duncan Coutts * Add a bunch of my parser test progs They actually need an extra function exported from the parser to work. I'll fix that soonish. A ./c2hs/c/tests/CCWrapper.hs A ./c2hs/c/tests/Makefile A ./c2hs/c/tests/ParseUnit.hs A ./c2hs/c/tests/cc-wrapper.sh From vivian.mcphail at paradise.net.nz Fri Apr 20 00:31:16 2007 From: vivian.mcphail at paradise.net.nz (Vivian McPhail) Date: Fri Apr 20 00:30:56 2007 Subject: [C2hs] RE: darcs patch: added cppOptions and c2hsOptions Message-ID: <007a01c78304$bc83ca90$6601a8c0@box> Hi Duncan, I added cppOptions because in the Cabal.cabal file there was a comment to add cppOptions and so I did it. With respect to c2hsOptions, the problem is that c2hs passes options to the CPP nonstandardly (with --cppopts=), so even if I have an -I* option in my ccOptions that gets passed to c2hs, this works for c2hs, but doesn't get passed to the cpp that c2hs uses. I've sent a message to the c2hs/cabal mailing list with a dummy package that recreates all the problems I had on mingw/WinXP. The reason the c files are outside the Cabal hierarchy is that they are supposed to mimic libs/headers that are already on the system and would (normally) be found with an autoconf script. I think it would be a great idea to change the name of the .h file that c2hs generates. It would make naming Haskell sources/modules more consistent with their targets. Cheers, Vivian > -----Original Message----- > From: Duncan Coutts [mailto:duncan.coutts@worc.ox.ac.uk] > Sent: Wednesday, 18 April 2007 3:31 p.m. > To: Vivian McPhail > Cc: cabal-devel@haskell.org > Subject: Re: darcs patch: added cppOptions and c2hsOptions > > On Wed, 2007-04-04 at 03:33 +1200, Vivian McPhail wrote: > > > Wed Apr 4 03:32:49 New Zealand Standard Time 2007 Vivian McPhail > > > > * added cppOptions and c2hsOptions > > Hia Vivian, > > Can you explain to me again exactly why we need these extra options? > As I see it, cpp options can just be included in the cc options, is > there any need to separate them? > > Cabal currently looks for -D* -U* and -I* flags in the cc options and > passes them to c2hs. Are there any other ones that we are missing > there? > It's quite convenient for users not to have to separate the cc flags > into cpp ones, since many other tools intermingle them (off the top of > my head I can think of pkg-config). > > As for the c2hs options, again I'm not clear as to why this is > necessary. c2hs doesn't support that many interesting flags: > > -C CPPOPTS --cppopts=CPPOPTS pass CPPOPTS to the C preprocessor > -c CPP --cpp=CPP use executable CPP to > invoke C preprocessor > -d TYPE --dump=TYPE dump internal information > (for debugging) > -h, -? --help brief help (the present message) > -i INCLUDE --include=INCLUDE include paths for .chi files > -k --keep keep pre-processed C header > -l --copy-library copy `C2HS' library module in > -o FILE --output=FILE output result to FILE > (should end in .hs) > -p PLATFORM --platform=PLATFORM platform to use for cross > compilation > -t PATH --output-dir=PATH place generated files in PATH > -v --version show version information > > I think all of these are either not useful or can be selected > automatically. > > As for the optional .h file that can be passed on the command line, > the better way to do that is to put the #include inside the .chs file. > > The alternative is to extend c2hs to accept many .h files on the > command line and we can pass all the files in the 'includes:' field to > c2hs. I'm considering extending c2hs to allow this. I'm also planning > to change c2hs so that the .h file it generates will not clash with > anything else, for foo.chs it'll generate foo.chs.h and possibly > foo.chs.c too. > > Is there anything I've missed? > > Duncan > From duncan.coutts at worc.ox.ac.uk Fri Apr 20 02:01:01 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Fri Apr 20 01:59:01 2007 Subject: [C2hs] patch applied (c2hs): Put myself as primary author and update docs Message-ID: <20070420060101.GA23551@cvs.haskell.org> Thu Apr 19 22:54:52 PDT 2007 Duncan Coutts * Put myself as primary author and update docs I've rewritten it twice so should probably list myself as main author. It is of course derived from Manuel Chakravarty's original c2hs C parser and from James A. Roskind's C grammar and the copyright notices reflect that. We need to double check Mr Roskind's copyright license to make sure we're respecting it properly. Also remove some docs that don't really apply anymore and add a couple TODOs. M ./c2hs/c/CParser.y -33 +9 From duncan.coutts at worc.ox.ac.uk Fri Apr 20 02:01:03 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Fri Apr 20 01:59:01 2007 Subject: [C2hs] patch applied (c2hs): Make the cc-wrapper program work without needing any hacking Message-ID: <20070420060103.GA23571@cvs.haskell.org> Thu Apr 19 22:59:49 PDT 2007 Duncan Coutts * Make the cc-wrapper program work without needing any hacking M ./c2hs/c/tests/CCWrapper.hs -21 +21 From duncan.coutts at worc.ox.ac.uk Fri Apr 20 03:12:44 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Fri Apr 20 03:10:48 2007 Subject: [C2hs] anyone interested in developing a Language.C library? Message-ID: <1177053165.25192.220.camel@localhost> Hi all, If anyone is interested in developing a Language.C library, I've just completed a full C parser which we're using in c2hs. It covers all of C99 and all of the GNU C extensions that I have found used in practise, including the __attribute__ annotations. It can successfully parse the whole Linux kernel and all of the C files in all the system packages on my Gentoo installation. It's implemented as an alex lexer and a happy parser. The happy grammar has one shift/reduce conflict for the dangling if/then/else issue (which could be hidden by using precedence but it's clearer not to). So if someone is interested in developing a more widely usable Language.C library, I think this would be a good place to start. There's plenty to do however: * The c2hs C AST is ok but probably not enough for a general purpose library. * The parser currently uses some other c2hs infrastructure which would need disentangling to pull the parser out (mostly identifiers and unique name supply management). * It does not record everything into the parse tree, eg __attribute__s are parsed but ignored. * It does no semantic analysis after parsing (though other bits of c2hs to a very little) * In at least one place the parser is deliberately too liberal (to avoid ambiguities) which would require simple extra checks after parsing to detect. * The lexical syntax has not been checked against the spec fully, it is probably over-liberal in some cases. * I've not done much performance work, the lexer has not been seriously tuned, it still lexes via a String. Having said that, the performance is not at all bad, on a 3Ghz box it does ~20k lines/sec. * The parser error messages are terrible (it might be interesting to try porting from happy to frown for this purpose) There's probably more stuff, but that's what I can think of right now. So if anyone is interested then let me know, I can give some pointers (hopefully the useful kind, not the void * kind). You can get the code from the c2hs darcs repo: darcs get --partial http://darcs.haskell.org/c2hs/ The C parser bits are under c2hs/c/ Duncan Licensing: It's not 100% clear. At the moment it's marked as GPL, but it's derived from several sources so we need to be careful about that. Personally I'm happy to use LGPL. It derives from c2hs obviously, which is GPL, though we could enquire about re-licencing, especially since there is very little of c2hs stuff used in it any more. It also derives partly from James A. Roskind's C grammar (in particular the grammar of declarations). His copyright license is fairly liberal but this need double-checking. It also derives from the C99 spec and I read the comments in the gcc C parser as a guide to GNU C's extensions to the C grammar (no code or comments were copied however). Testing: I tested it thus far by writing a little gcc wrapper script, so you can build any ordinary bit of C software using this wrapper and it'll call gcc with the same args but it'll also try and parse the input file. It reports into a log file. I've not tried the gcc C parser testsuite. This approach is probably good for other tests like trying to see if parsing and pretty printing can round-trip correctly; if not identical token streams (since parsing drops redundant brackets etc) checking if gcc produces identical .S/.o files. Something that c2hs needs is to calculate sizes of types and structure member offsets correctly. This is also something that could be tested in this style, by comparing on thousands of example .c files with what gcc thinks. From chak at cse.unsw.edu.au Fri Apr 20 06:31:28 2007 From: chak at cse.unsw.edu.au (Manuel M T Chakravarty) Date: Fri Apr 20 06:29:37 2007 Subject: [C2hs] anyone interested in developing a Language.C library? In-Reply-To: <1177053165.25192.220.camel@localhost> References: <1177053165.25192.220.camel@localhost> Message-ID: <46289680.8010708@cse.unsw.edu.au> Duncan Coutts wrote: > If anyone is interested in developing a Language.C library, I've just > completed a full C parser which we're using in c2hs. > > It covers all of C99 and all of the GNU C extensions that I have found > used in practise, including the __attribute__ annotations. It can > successfully parse the whole Linux kernel and all of the C files in all > the system packages on my Gentoo installation. Great work! Using this as a basis for a Language.C would be a really worthwile project. > Licensing: > It's not 100% clear. At the moment it's marked as GPL, but it's derived > from several sources so we need to be careful about that. Personally I'm > happy to use LGPL. It derives from c2hs obviously, which is GPL, though As far as I am concerned, LGPL is fine. Manuel From duncan.coutts at worc.ox.ac.uk Sat Apr 21 07:37:51 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sat Apr 21 07:35:53 2007 Subject: [Haskell-cafe] Re: [C2hs] anyone interested in developing a Language.C library? In-Reply-To: <8dde104f0704210304x64fef7f1u3020b99007451d7c@mail.gmail.com> References: <1177053165.25192.220.camel@localhost> <46289680.8010708@cse.unsw.edu.au> <20070421003903.GB8665@cse.unsw.EDU.AU> <8dde104f0704210304x64fef7f1u3020b99007451d7c@mail.gmail.com> Message-ID: <1177155471.7696.7.camel@localhost> On Sat, 2007-04-21 at 12:04 +0200, Josef Svenningsson wrote: > Unfortunately the niche is not empty. There is an ocaml library called > cil which is supposed to be pretty sweet for manipulating C code. But > I still think a Haskell library would be a very good idea, and perhaps > one can look at cil for inspiration. > > cil can be found here: > http://hal.cs.berkeley.edu/cil/ Yeah, I came across this recently. It's pretty decent looking. I briefly looked at their C parser (also implemented as a lex/yacc style lexer & parser). Theirs also covers Sun and MS C language extensions, that is Sun CC's pragmas and MS's numerous extensions. Sadly this didn't popup when I was googling for yacc style LALR(1) C grammars or I might have saved myself some time by porting their grammar to alex+happy. Duncan From duncan.coutts at worc.ox.ac.uk Wed Apr 25 02:17:27 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Apr 25 02:15:09 2007 Subject: [C2hs] patch applied (c2hs): Use .chs.h suffix for generated header files Message-ID: <20070425061727.GA15548@cvs.haskell.org> Tue Apr 24 21:30:49 PDT 2007 Duncan Coutts * Use .chs.h suffix for generated header files Hopefully this will not clash with user's own .h files. M ./c2hs/toplevel/Main.hs -1 +1 From duncan.coutts at worc.ox.ac.uk Wed Apr 25 02:17:29 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Apr 25 02:15:11 2007 Subject: [C2hs] patch applied (c2hs): Allow any number of .h files to be passed on the command line Message-ID: <20070425061729.GA15568@cvs.haskell.org> Tue Apr 24 21:33:40 PDT 2007 Duncan Coutts * Allow any number of .h files to be passed on the command line They'll all be added to the generated .chs.h file. This will allow cabal to pass all the .h files listed in the .cabal file. M ./c2hs/toplevel/Main.hs -28 +27 From duncan.coutts at worc.ox.ac.uk Wed Apr 25 02:17:30 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Apr 25 02:15:11 2007 Subject: [C2hs] patch applied (c2hs): In the common case of #include' ing a single header we don' t need a .chs.h file Message-ID: <20070425061730.GA15583@cvs.haskell.org> Tue Apr 24 21:37:20 PDT 2007 Duncan Coutts * In the common case of #include'ing a single header we don't need a .chs.h file So say if you do: ch2s foo.h foo.chs and you don't add any other includes in the .chs file then it's kind of annoying to have to generate this tiny .chs.h file that just contains #include "foo.h" we could instead make the ffi imports in the .hs file refer directly to foo.h rather than indirectly via foo.chs.h. Annoyingly we still have to actualy generate foo.chs.h to pass to cpp to get foo.chs.i, but we can delete foo.chs.h immediately after so the user never sees it. M ./c2hs/toplevel/Main.hs -3 +16 From duncan.coutts at worc.ox.ac.uk Wed Apr 25 02:17:31 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Apr 25 02:15:14 2007 Subject: [C2hs] patch applied (c2hs): Add a --numeric-version flag, just like ghc has Message-ID: <20070425061731.GA15598@cvs.haskell.org> Tue Apr 24 21:42:30 PDT 2007 Duncan Coutts * Add a --numeric-version flag, just like ghc has Should make it easier for build tools like cabal to check the c2hs version. M ./c2hs/toplevel/Main.hs -8 +14 M ./c2hs/toplevel/Version.hs -1 +1 From duncan.coutts at worc.ox.ac.uk Wed Apr 25 02:17:33 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Apr 25 02:15:15 2007 Subject: [C2hs] patch applied (c2hs): Remove redundancy in the representation of pointer declarators Message-ID: <20070425061733.GA15612@cvs.haskell.org> Tue Apr 24 22:29:29 PDT 2007 Duncan Coutts * Remove redundancy in the representation of pointer declarators It was an artifact of the previous parser that we represented a whole list of pointer type modifiers in one go rather than a single ast constructor for each pointer layer as we do now. This is simpler. M ./c2hs/c/CAST.hs -1 +1 M ./c2hs/c/CParser.y -20 +20 M ./c2hs/c/CPretty.hs -1 +1 M ./c2hs/c/CTrav.hs -5 +2