Ticket #1101 (reopened defect)

Opened 7 years ago

Last modified 22 months ago

parse error in c2hs in gobject.i

Reported by: guest Owned by: somebody
Priority: normal Milestone:
Component: C2Hs (Gtk2Hs fork) Version:
Keywords: locale Cc: jesusalbertosanchez@…

Description

This problem was originally reported as a reply of #1099 but I think it's different.

I have the same problem compiling the development version in ubuntu 7.10 32bit with the official binary distribution of ghc 6.8.2, it seems that the problem is that c2hsLocan can't parse glib-objcet.i, i get the following message, trying to make the glib bindings:

./tools/c2hs/c2hsLocal +RTS -RTS -C-I/usr/include/glib-2.0 -C-I/usr/lib/glib-2.0/include --cppopts='-include"gtk2hsconfig.h"' --precomp=glib/glib.precomp glib-object.h
En el fichero incluído de /usr/include/glib2.0/glib/gthread.h:32,
de /usr/include/glib-2.0/glib/gasyncqueue.h:30,
de /usr/include/glib-2.0/glib.h:32,
de /usr/include/glib2.0/gobject/gtype.h:26,
de /usr/include/glib-2.0/gobject/gboxed.h:26,
de /usr/include/glib-2.0/glib-object.h:25:
/usr/include/glib-2.0/glib/gutils.h:426:1: aviso: se redefinió "GLIB_CHECK_VERSION" En el fichero incluído de <línea deorden>:1: ./gtk2hs-config.h:179:1: aviso: esta es la ubicación de la definición previa c2hsLocal: Error in C header file.
<interno>:1: (column 0) [FATAL]
>>> Lexical error! The character '#' does not fit here.
make[2]: *** [glib/glib.precomp] Error 1 make[2]: se sale del directorio '/home/alberto/tmp/gtk2hs' make[1]: *** glib/System/Glib/Types.hs] Error 2 make[1]: se sale del directorio `/home/alberto/tmp/gtk2hs'}}}

Attachments

patch.txt (9.4 kB) - added by guest 22 months ago.
c2hs #7 workaroud

Change History

Changed 7 years ago by guest

  • milestone set to 0.9.13

I'd like to see this fixed!

Could you run the c2hsLocal command line form above but add a --keep flag and post the gobject.i file?

Thanks, Axel.

Changed 7 years ago by anonymous

Thanks for helping me, this is what i get from the command:

 ./tools/c2hs/c2hsLocal -d trace +RTS -RTS -C-I/usr/include/glib-2.0 -C-I/usr/lib/glib-2.0/include --cppopts='-include "gtk2hs-config.h"' --precomp=glib/glib.precomp --keep glib-object.h 
Invoking cpp as `gcc -E  -x c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -include "gtk2hs-config.h" /usr/include/glib-2.0/glib-object.h >glib-object.i'...
En el fichero incluído de /usr/include/glib-2.0/glib/gthread.h:32,
                 de /usr/include/glib-2.0/glib/gasyncqueue.h:30,
                 de /usr/include/glib-2.0/glib.h:32,
                 de /usr/include/glib-2.0/gobject/gtype.h:26,
                 de /usr/include/glib-2.0/gobject/gboxed.h:26,
                 de /usr/include/glib-2.0/glib-object.h:25:
/usr/include/glib-2.0/glib/gutils.h:426:1: aviso: se redefinió "GLIB_CHECK_VERSION"
En el fichero incluído de <línea de orden>:1:
./gtk2hs-config.h:179:1: aviso: esta es la ubicación de la definición previa
Attempting to read file `glib-object.i'...
...parsing `glib-object.i'...
c2hsLocal: Error in C header file.

<interno>:1: (column 0) [FATAL] 
  >>> Lexical error!
  The character '#' does not fit here.

and the glib-object.i: http://pastebin.com/fce9291a

thanks, and sorry for my ugly english

Changed 7 years ago by as49@…

  • keywords locale added

The trouble is that you're working in a spanish locale (which is fine) and that CPP emits non-ASCII characters into the intermediate file (which is not fine). This breaks the lexer of c2hs since it only expects ASCII characters in file names. I have changed this and pushed the changed into the repository. However, I have no way of testing this as my gcc doesn't seem to care about locale settings. Is it possible for you to use the current darcs development snapshot and try again?

Changed 7 years ago by anonymous

Many thanks, that's work wonderfull. :D

Jesús Alberto Sánchez Pimienta.

Changed 7 years ago by axel

  • status changed from new to closed
  • resolution set to fixed

Changed 5 years ago by Alvaro

The shortest distance between two points is under construction.

-- Noelie Alito

farmaci stimolante erezione order cheap brand fioricet ordina cialis tramadol pain relief

Changed 22 months ago by guest

c2hs #7 workaroud

Changed 22 months ago by guest

  • status changed from closed to reopened
  • resolution fixed deleted
  • version 0.9.12 deleted
  • component changed from general (Gtk+, Glib) to C2Hs (Gtk2Hs fork)
  • milestone 0.9.13 deleted

May be it's a fix, C code with embed multi-byte-char code is very very rare, and probably illegal.

so the "cpp" output vary in diffrent translation by diffent locale is odd.

Note: See TracTickets for help on using tickets.