[ragel-users] Build failures with GCC 4.4
Diego E. “Flameeyes” Pettenò
flameeyes at gmail.com
Tue May 19 18:44:47 UTC 2009
Seems like yesterday I tried with the “wrong” compiler (that is, the
compiler that is actually used rather than the one I should test with).
While GCC 4.3 compiles Ragel 6.5 fine, GCC 4.4 errors out, because the
string functions are now declared in such a way that they return “const
char *” when given “const char *” and “char *” when given “char *”.
I'm attaching the half good part of the patch I've applied to the Gentoo
ebuild, the other half is actually just a const_cast which is _nasty_;
the problem is at main.c:339; the eq variable is a pointer to
non-constant, and is indeed modified on line 342.
The solution would be, I guess, to use strncmp instead of setting eq to
\0. This way you never modify the string and you can use constant
strings.
HTH,
--
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/
If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.4-part1.patch
Type: text/x-patch
Size: 392 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090519/a5df0d75/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Questa è una parte del messaggio firmata digitalmente
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090519/a5df0d75/attachment-0001.sig>
More information about the ragel-users
mailing list