From vivian.mcphail at paradise.net.nz Mon Oct 2 02:01:07 2006 From: vivian.mcphail at paradise.net.nz (Vivian McPhail) Date: Mon Oct 2 01:07:13 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h Message-ID: <000901c6e5e8$2eb7d210$4500a8c0@box> Hi, running GHC 6.5.20060831, mingw 1) darcs repo error: Patch 107 can't be applied. Some problem with case-sensitivity. Issue234 of darcs is a bugs report on case-sensitivity, and Heffalump on #darcs is examining this problem. Heffalump has created a repo that fixes this problem: HYPERLINK "http://urchin.earth.li/darcs/ganesh/c2hs"http://urchin.earth.-li/darcs/gane sh/c2hs 2) ./Setup.hs install error: $ ./Setup.hs install Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6\ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin c2hs-0.14.6... '.' is not recognized as an internal or external command, operable program or batch file. Some problem with backslashes and windows. I got around this problem by installing by hand. 3) syntax error $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs c2hs.exe: Generic fatal error. C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/floa t.h:125: (column 8) [FATAL] >>> Syntax error! The symbol `__attribute__' does not fit here. Cheers, Vivian -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.407 / Virus Database: 268.12.11/460 - Release Date: 1/10/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/c2hs/attachments/20061002/6df6b100/attachment.htm From gejunchuan at yahoo.com.cn Fri Oct 6 20:44:10 2006 From: gejunchuan at yahoo.com.cn (george) Date: Fri Oct 6 19:49:55 2006 Subject: [C2hs] cooperation Message-ID: <20061007004411.4997.qmail@web15915.mail.cnb.yahoo.com> Dear sir, Glad to receive your email, hope cooperation. Best regards, George www.voile-curtain.com --------------------------------- ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä-3.5GÈÝÁ¿£¬20M¸½¼þ£¡ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/c2hs/attachments/20061007/61602653/attachment.htm From duncan.coutts at worc.ox.ac.uk Sun Oct 8 19:26:39 2006 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sun Oct 8 18:33:37 2006 Subject: [C2hs] yet another C parser Message-ID: <1160349999.4062.683.camel@localhost> All, over the weekend I had another stab at fixing issues in the c2hs C parser. I've been annoyed for some time that the basic typedef problem is not solved. I know some of the other problems are the various GNU extensions. Recall that there is this annoying context-dependency in the C grammar, that parsing depends on if an identifier had been declared as a typedef'ed identifier withing the enclosing scope. There's two things the current grammar gets wrong. One is that it doesn't accept identifiers & typedefs correctly in all the right situations. This was because my attempts to add them in the right places led to huge numbers of shift/reduce conflicts in the grammar. The other is that it doesn't do nested scopes properly, it assumes only one global scope. So currently, typedef'ed names to not go out of scope when they should do. So I started with James A. Roskind's C grammar for YACC. Google for it, there's lots of info on it. Anyway, I ported that to happy and indeed it does build with just the one expected shift/reduce conflict (for if/then/else). So the plan I suppose, would be to integrate this with the current lexer. This involves adding the semantic actions at just the right points to have typedef'ed names added and removed from the typedef'ed name set at just the right times and then testing the parser on a bunch of nasty torture cases. There are some suggested by Roskind here: http://compilers.iecc.com/comparch/article/92-01-056 eg, try this one: typedef int A, B(A); which should be equivalent to: typedef int A; typedef int B(int); /* B's type is a function taking an int and returning an int */ Terrifying stuff :-) I was also looking at a cheap automatic test for the parser. The idea is just to try and parse every .h file in /usr/include. We can filter out just the ones that compile on their own with gcc (since some need extra -I dirs or -D defines). At the moment on my machine with the current c2hs parser I get: 225 headers could be parsed ok 38 headers failed with parse errors Of the failures, most are related to __attribute__ of some sort. Some are C99 features like restrict or _Bool. There are a few otherwise uncategorised parse errors. We could probably extend this style of automatic testing to standard C packages by providing a c2hs wrapper that pretends to be gcc. Eg we'd use something like: export CC="c2hs-ccwrapper" export LD="c2hs-ldwrapper" ./configure make to make the build system work ok we'd need to produce dummy .o files etc. We might be able to test vast amounts of C code this way. Something slightly less ambitious might be to test the .h files for all pkg-config packages, since pkg-config provides all the necessary -I & -D flags. Testing the correctness of c2hs's c type sizeof calculation and struct member offsetof calculations could be done in a similar way. After parsing we could extract all the types, generate a .c file that gets gcc to tests the sizeof and compares that to the size c2hs calculates. Duncan From jelmer at samba.org Sun Oct 8 21:47:18 2006 From: jelmer at samba.org (Jelmer Vernooij) Date: Sun Oct 8 20:52:56 2006 Subject: [C2hs] yet another C parser In-Reply-To: <1160349999.4062.683.camel@localhost> References: <1160349999.4062.683.camel@localhost> Message-ID: <1160358438.6309.14.camel@ganieda.lan.vernstok.nl> Hi Duncan, On Mon, 2006-10-09 at 00:26 +0100, Duncan Coutts wrote: > over the weekend I had another stab at fixing issues in the c2hs C > parser. I've been annoyed for some time that the basic typedef problem > is not solved. I know some of the other problems are the various GNU > extensions. > > Recall that there is this annoying context-dependency in the C grammar, > that parsing depends on if an identifier had been declared as a > typedef'ed identifier withing the enclosing scope. > > There's two things the current grammar gets wrong. One is that it > doesn't accept identifiers & typedefs correctly in all the right > situations. This was because my attempts to add them in the right places > led to huge numbers of shift/reduce conflicts in the grammar. The other > is that it doesn't do nested scopes properly, it assumes only one global > scope. So currently, typedef'ed names to not go out of scope when they > should do. > > So I started with James A. Roskind's C grammar for YACC. Google for it, > there's lots of info on it. Anyway, I ported that to happy and indeed it > does build with just the one expected shift/reduce conflict (for > if/then/else). > > So the plan I suppose, would be to integrate this with the current > lexer. This involves adding the semantic actions at just the right > points to have typedef'ed names added and removed from the typedef'ed > name set at just the right times and then testing the parser on a bunch > of nasty torture cases. There are some suggested by Roskind here: > > http://compilers.iecc.com/comparch/article/92-01-056 > > eg, try this one: > typedef int A, B(A); > > which should be equivalent to: > > typedef int A; > typedef int B(int); > /* B's type is a function taking an int and returning an int */ > > Terrifying stuff :-) > > > I was also looking at a cheap automatic test for the parser. The idea is > just to try and parse every .h file in /usr/include. We can filter out > just the ones that compile on their own with gcc (since some need extra > -I dirs or -D defines). > > At the moment on my machine with the current c2hs parser I get: > > 225 headers could be parsed ok > 38 headers failed with parse errors > > Of the failures, most are related to __attribute__ of some sort. Some > are C99 features like restrict or _Bool. There are a few otherwise > uncategorised parse errors. > We could probably extend this style of automatic testing to standard C > packages by providing a c2hs wrapper that pretends to be gcc. Eg we'd > use something like: > export CC="c2hs-ccwrapper" > export LD="c2hs-ldwrapper" > ./configure > make > > to make the build system work ok we'd need to produce dummy .o files > etc. We might be able to test vast amounts of C code this way. Yeah, that'd certainly make sense. I have to manually trim the includes on my system when writing .chs files because of system headers that c2hs can't parse because of weird attributes. Cheers, Jelmer -- Jelmer Vernooij - http://samba.org/~jelmer/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://www.haskell.org/pipermail/c2hs/attachments/20061009/14992711/attachment.bin From chak at cse.unsw.edu.au Tue Oct 10 16:31:43 2006 From: chak at cse.unsw.edu.au (Manuel M T Chakravarty) Date: Tue Oct 10 15:37:18 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h In-Reply-To: <000901c6e5e8$2eb7d210$4500a8c0@box> References: <000901c6e5e8$2eb7d210$4500a8c0@box> Message-ID: <1160512303.2244.61.camel@trinity.localdomain> Hi Vivian, > running GHC 6.5.20060831, mingw > > 1) darcs repo error: > Patch 107 can't be applied. Some problem with case-sensitivity. > Issue234 of darcs is a bugs report on case-sensitivity, and Heffalump > on #darcs is examining this problem. > > Heffalump has created a repo that fixes this problem: > http://urchin.earth.li/darcs/ganesh/c2hs Does that also happen if you get the repo with --partial? If yes, maybe we can get around it by adding another, more recent, checkpoint. > 2) ./Setup.hs install error: > > $ ./Setup.hs install > Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6 > \ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin c2hs-0.14.6... > '.' is not recognized as an internal or external command, > operable program or batch file. > > Some problem with backslashes and windows. > > I got around this problem by installing by hand. Yes, I am sorry, this is a known problem on windows, which is on the list of things to be fixed. > 3) syntax error > > $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include > --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs > c2hs.exe: Generic fatal error. > > C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/float.h:125: (column 8) [FATAL] > >>> Syntax error! > The symbol `__attribute__' does not fit here. __attribute__ is a not very well documented extension of gcc. c2hs can handle many cases of __attribute__, but unfortunately some don't work yet. However, there is a work around. Please see the following message from the list archive: http://www.haskell.org/pipermail/c2hs/2006-May/000577.html Manuel From chak at cse.unsw.edu.au Tue Oct 10 16:34:35 2006 From: chak at cse.unsw.edu.au (Manuel M T Chakravarty) Date: Tue Oct 10 15:40:07 2006 Subject: [C2hs] cant figure out how to use c2hs, what am i doing wrong? In-Reply-To: References: Message-ID: <1160512475.2244.64.camel@trinity.localdomain> Anatoly, > I have a simple fftw wrapper which c2hs builds into a .hs file, but > when i try to use it i get an error: > > $ ghc -v --make -fffi Main.hs > Glasgow Haskell Compiler, Version 6.4.2, for Haskell 98, compiled by > GHC version 6.4.2 > Using package config file: /usr/lib/ghc-6.4.2/package.conf > Hsc static flags: -static > *** Chasing dependencies: > Chasing modules from: Main.hs > *** Deleting temp files > Deleting: > > Fftw.chs:2:0: parse error on input `import' > > here is my Fftw.chs: > module Fftw (fftwNew, fftwDestroy, fftwExecute) You need to add the keyword "where" after the export list. (This is really a Haskell error and nothing to do with c2hs). > import C2HS [..] Manuel From vivian.mcphail at paradise.net.nz Wed Oct 11 01:43:49 2006 From: vivian.mcphail at paradise.net.nz (Vivian McPhail) Date: Wed Oct 11 00:49:18 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h In-Reply-To: <1160512303.2244.61.camel@trinity.localdomain> Message-ID: <001001c6ecf8$3b93bbe0$4300a8c0@box> 1) darcs repo error: Also happens with --partial. 3) Thanks for the link, I'll follow it up. > -----Original Message----- > From: Manuel M T Chakravarty [mailto:chak@cse.unsw.edu.au] > Sent: Wednesday, 11 October 2006 9:32 a.m. > To: Vivian McPhail > Cc: c2hs@haskell.org > Subject: Re: [C2hs] Problems with c2hs, including > `__attribute__' symbol in _mingw.h > > Hi Vivian, > > > running GHC 6.5.20060831, mingw > > > > 1) darcs repo error: > > Patch 107 can't be applied. Some problem with case-sensitivity. > > Issue234 of darcs is a bugs report on case-sensitivity, and > Heffalump > > on #darcs is examining this problem. > > > > Heffalump has created a repo that fixes this problem: > > http://urchin.earth.li/darcs/ganesh/c2hs > > Does that also happen if you get the repo with --partial? If > yes, maybe we can get around it by adding another, more > recent, checkpoint. > > > 2) ./Setup.hs install error: > > > > $ ./Setup.hs install > > Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6 > > \ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin > c2hs-0.14.6... > > '.' is not recognized as an internal or external command, operable > > program or batch file. > > > > Some problem with backslashes and windows. > > > > I got around this problem by installing by hand. > > Yes, I am sorry, this is a known problem on windows, which is > on the list of things to be fixed. > > > 3) syntax error > > > > $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include > > --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs > > c2hs.exe: Generic fatal error. > > > > > C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../. > ./include/float.h:125: (column 8) [FATAL] > > >>> Syntax error! > > The symbol `__attribute__' does not fit here. > > __attribute__ is a not very well documented extension of gcc. > c2hs can handle many cases of __attribute__, but > unfortunately some don't work yet. However, there is a work > around. Please see the following message from the list archive: > > http://www.haskell.org/pipermail/c2hs/2006-May/000577.html > > Manuel > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.407 / Virus Database: 268.13.1/466 - Release > Date: 7/10/2006 > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.407 / Virus Database: 268.13.1/466 - Release Date: 7/10/2006 From vivian.mcphail at paradise.net.nz Wed Oct 11 01:56:42 2006 From: vivian.mcphail at paradise.net.nz (Vivian McPhail) Date: Wed Oct 11 01:02:26 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h In-Reply-To: <1160512303.2244.61.camel@trinity.localdomain> Message-ID: <001101c6ecfa$095878d0$4300a8c0@box> Hi, Regarding (3): I tried to do as was suggested in linked mail. This first run is without the fix, clearly matrix.h is found $ c2hs --cppopts='-I/c/Apps/MATLAB704/extern/include' --include=C:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs c2hs.exe: Generic fatal error. C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/floa t.h:125: (column 8) [FATAL] >>> Syntax error! The symbol `__attribute__' does not fit here. This is the second run, with the appropriate defs to get rid of the problem. Clearly the args to --cppopts are getting screwed up. I also tried with "-I..." but got the same error. $ c2hs --cppopts='-I/c/Apps/MATLAB704/extern/include -D__asm__(A)= -D__attribute__(A)=' --include=C:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs MxMatrix.h:1:20: matrix.h: No such file or directory c2hs.exe: Error during preprocessing custom header file What am I not doing correctly? Vivian > -----Original Message----- > From: Manuel M T Chakravarty [mailto:chak@cse.unsw.edu.au] > Sent: Wednesday, 11 October 2006 9:32 a.m. > To: Vivian McPhail > Cc: c2hs@haskell.org > Subject: Re: [C2hs] Problems with c2hs, including > `__attribute__' symbol in _mingw.h > > Hi Vivian, > > > running GHC 6.5.20060831, mingw > > > > 1) darcs repo error: > > Patch 107 can't be applied. Some problem with case-sensitivity. > > Issue234 of darcs is a bugs report on case-sensitivity, and > Heffalump > > on #darcs is examining this problem. > > > > Heffalump has created a repo that fixes this problem: > > http://urchin.earth.li/darcs/ganesh/c2hs > > Does that also happen if you get the repo with --partial? If > yes, maybe we can get around it by adding another, more > recent, checkpoint. > > > 2) ./Setup.hs install error: > > > > $ ./Setup.hs install > > Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6 > > \ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin > c2hs-0.14.6... > > '.' is not recognized as an internal or external command, operable > > program or batch file. > > > > Some problem with backslashes and windows. > > > > I got around this problem by installing by hand. > > Yes, I am sorry, this is a known problem on windows, which is > on the list of things to be fixed. > > > 3) syntax error > > > > $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include > > --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs > > c2hs.exe: Generic fatal error. > > > > > C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../. > ./include/float.h:125: (column 8) [FATAL] > > >>> Syntax error! > > The symbol `__attribute__' does not fit here. > > __attribute__ is a not very well documented extension of gcc. > c2hs can handle many cases of __attribute__, but > unfortunately some don't work yet. However, there is a work > around. Please see the following message from the list archive: > > http://www.haskell.org/pipermail/c2hs/2006-May/000577.html > > Manuel > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.407 / Virus Database: 268.13.1/466 - Release > Date: 7/10/2006 > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.407 / Virus Database: 268.13.1/466 - Release Date: 7/10/2006 From chak at cse.unsw.edu.au Wed Oct 11 16:36:38 2006 From: chak at cse.unsw.edu.au (Manuel M T Chakravarty) Date: Wed Oct 11 15:42:10 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h In-Reply-To: <001101c6ecfa$095878d0$4300a8c0@box> References: <001101c6ecfa$095878d0$4300a8c0@box> Message-ID: <1160598998.2244.119.camel@trinity.localdomain> Vivian McPhail: > This is the second run, with the appropriate defs to get rid of the problem. > Clearly the args to --cppopts are getting screwed up. I also tried with > "-I..." but got the same error. > > > $ c2hs --cppopts='-I/c/Apps/MATLAB704/extern/include -D__asm__(A)= > -D__attribute__(A)=' --include=C:/Apps/MATLAB704/extern/include matrix.h > MxMatrix.chs > MxMatrix.h:1:20: matrix.h: No such file or directory > c2hs.exe: Error during preprocessing custom header file I think, you need to put the argument to -D in extra quotes, like so --cppopts='-I/c/Apps/MATLAB704/extern/include -D"__asm__(A)= " -D"__attribute__(A)= "' Manuel > > > -----Original Message----- > > From: Manuel M T Chakravarty [mailto:chak@cse.unsw.edu.au] > > Sent: Wednesday, 11 October 2006 9:32 a.m. > > To: Vivian McPhail > > Cc: c2hs@haskell.org > > Subject: Re: [C2hs] Problems with c2hs, including > > `__attribute__' symbol in _mingw.h > > > > Hi Vivian, > > > > > running GHC 6.5.20060831, mingw > > > > > > 1) darcs repo error: > > > Patch 107 can't be applied. Some problem with case-sensitivity. > > > Issue234 of darcs is a bugs report on case-sensitivity, and > > Heffalump > > > on #darcs is examining this problem. > > > > > > Heffalump has created a repo that fixes this problem: > > > http://urchin.earth.li/darcs/ganesh/c2hs > > > > Does that also happen if you get the repo with --partial? If > > yes, maybe we can get around it by adding another, more > > recent, checkpoint. > > > > > 2) ./Setup.hs install error: > > > > > > $ ./Setup.hs install > > > Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6 > > > \ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin > > c2hs-0.14.6... > > > '.' is not recognized as an internal or external command, operable > > > program or batch file. > > > > > > Some problem with backslashes and windows. > > > > > > I got around this problem by installing by hand. > > > > Yes, I am sorry, this is a known problem on windows, which is > > on the list of things to be fixed. > > > > > 3) syntax error > > > > > > $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include > > > --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs > > > c2hs.exe: Generic fatal error. > > > > > > > > C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../. > > ./include/float.h:125: (column 8) [FATAL] > > > >>> Syntax error! > > > The symbol `__attribute__' does not fit here. > > > > __attribute__ is a not very well documented extension of gcc. > > c2hs can handle many cases of __attribute__, but > > unfortunately some don't work yet. However, there is a work > > around. Please see the following message from the list archive: > > > > http://www.haskell.org/pipermail/c2hs/2006-May/000577.html > > > > Manuel > > > > > > > > -- > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.1.407 / Virus Database: 268.13.1/466 - Release > > Date: 7/10/2006 > > > > > From vivian.mcphail at paradise.net.nz Wed Oct 11 23:20:59 2006 From: vivian.mcphail at paradise.net.nz (Vivian McPhail) Date: Wed Oct 11 22:26:36 2006 Subject: [C2hs] Problems with c2hs, including `__attribute__' symbol in _mingw.h In-Reply-To: <1160598998.2244.119.camel@trinity.localdomain> Message-ID: <003001c6edad$70b541d0$4300a8c0@box> Hi, FYI. I tried putting the arguments in extra quotes, as suggested, however, many header files include _mingw.h which seems to redefine __attribute__. My solution (very ugly) was to hack the _mingw.h file to permanently redefine: #define __attribute__(x) So I need to remember to fix this before I compile anything. Apart from that c2hs seems to be working, now I just need to learn how to use it properly. Thanks, Vivian > -----Original Message----- > From: Manuel M T Chakravarty [mailto:chak@cse.unsw.edu.au] > Sent: Thursday, 12 October 2006 9:37 a.m. > To: Vivian McPhail > Cc: c2hs@haskell.org > Subject: RE: [C2hs] Problems with c2hs, including > `__attribute__' symbol in _mingw.h > > Vivian McPhail: > > This is the second run, with the appropriate defs to get > rid of the problem. > > Clearly the args to --cppopts are getting screwed up. I also tried > > with "-I..." but got the same error. > > > > > > $ c2hs --cppopts='-I/c/Apps/MATLAB704/extern/include -D__asm__(A)= > > -D__attribute__(A)=' --include=C:/Apps/MATLAB704/extern/include > > matrix.h MxMatrix.chs > > MxMatrix.h:1:20: matrix.h: No such file or directory > > c2hs.exe: Error during preprocessing custom header file > > I think, you need to put the argument to -D in extra quotes, like so > > --cppopts='-I/c/Apps/MATLAB704/extern/include > -D"__asm__(A)= " -D"__attribute__(A)= "' > > Manuel > > > > > > -----Original Message----- > > > From: Manuel M T Chakravarty [mailto:chak@cse.unsw.edu.au] > > > Sent: Wednesday, 11 October 2006 9:32 a.m. > > > To: Vivian McPhail > > > Cc: c2hs@haskell.org > > > Subject: Re: [C2hs] Problems with c2hs, including `__attribute__' > > > symbol in _mingw.h > > > > > > Hi Vivian, > > > > > > > running GHC 6.5.20060831, mingw > > > > > > > > 1) darcs repo error: > > > > Patch 107 can't be applied. Some problem with case-sensitivity. > > > > Issue234 of darcs is a bugs report on case-sensitivity, and > > > Heffalump > > > > on #darcs is examining this problem. > > > > > > > > Heffalump has created a repo that fixes this problem: > > > > http://urchin.earth.li/darcs/ganesh/c2hs > > > > > > Does that also happen if you get the repo with --partial? > If yes, > > > maybe we can get around it by adding another, more recent, > > > checkpoint. > > > > > > > 2) ./Setup.hs install error: > > > > > > > > $ ./Setup.hs install > > > > Installing: C:\Apps\MSYS\1.0\local\Haskell\c2hs-0.14.6 > > > > \ghc-6.5.20060831 & C:\Apps\MSYS\1.0\local\Haskell\bin > > > c2hs-0.14.6... > > > > '.' is not recognized as an internal or external > command, operable > > > > program or batch file. > > > > > > > > Some problem with backslashes and windows. > > > > > > > > I got around this problem by installing by hand. > > > > > > Yes, I am sorry, this is a known problem on windows, > which is on the > > > list of things to be fixed. > > > > > > > 3) syntax error > > > > > > > > $ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include > > > > --include=c:/Apps/MATLAB704/extern/include matrix.h MxMatrix.chs > > > > c2hs.exe: Generic fatal error. > > > > > > > > > > > C:/Apps/MSYS/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../. > > > ./include/float.h:125: (column 8) [FATAL] > > > > >>> Syntax error! > > > > The symbol `__attribute__' does not fit here. > > > > > > __attribute__ is a not very well documented extension of gcc. > > > c2hs can handle many cases of __attribute__, but > unfortunately some > > > don't work yet. However, there is a work around. Please see the > > > following message from the list archive: > > > > > > http://www.haskell.org/pipermail/c2hs/2006-May/000577.html > > > > > > Manuel > > > > > > > > > > > > -- > > > No virus found in this incoming message. > > > Checked by AVG Free Edition. > > > Version: 7.1.407 / Virus Database: 268.13.1/466 - Release > > > Date: 7/10/2006 > > > > > > > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.407 / Virus Database: 268.13.1/466 - Release > Date: 7/10/2006 > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.407 / Virus Database: 268.13.1/466 - Release Date: 7/10/2006