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/

--- a/ragel/main.cpp
+++ b/ragel/main.cpp
@@ -507,7 +507,7 @@ char *makeIntermedTemplate( const char *baseFileName )
 {
 	char *result = 0;
 	const char *templ = "ragel-XXXXXX.xml";
-	char *lastSlash = strrchr( baseFileName, '/' );
+	const char *lastSlash = strrchr( baseFileName, '/' );
 	if ( lastSlash == 0 ) {
 		result = new char[strlen(templ)+1];
 		strcpy( result, templ );

Attachment: signature.asc
Description: Questa è una parte del messaggio firmata digitalmente

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to