[PATCH xrdb] Call C preprocessor with -P option (changed behaviour in GCC 4.5)

Ulrich Mueller ulm at gentoo.org
Tue Dec 28 07:58:28 PST 2010


http://bugs.freedesktop.org/show_bug.cgi?id=32701
http://bugs.gentoo.org/show_bug.cgi?id=347758

Signed-off-by: Ulrich Mueller <ulm at gentoo.org>
---
 xrdb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xrdb.c b/xrdb.c
index 21005c0..2972da1 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -883,7 +883,10 @@ main(int argc, char *argv[])
 
 	for (j = 0; j < number_of_elements; j++) {
 	    if (access(cpp_locations[j], X_OK) == 0) {
-		cpp_program = cpp_locations[j];
+		if ((cpp_program =
+			(char *)malloc(strlen(cpp_locations[j]) + 4)) == NULL)
+		    fatal("%s: Out of memory\n", ProgramName);
+		sprintf(cpp_program, "%s -P", cpp_locations[j]);
 		break;
 	    }
 	} 
-- 
1.7.3.4


More information about the xorg-devel mailing list