Subject: Notification: incoming/738

From: [email-masked]
Date: Wed, 11 Jul 2001 06:02:22 -0500

FVWM Bug Tracking notification

new message incoming/738

Message summary for PR#738
	From: [email-masked]
	Subject: gcc-3.0 compilation with optimizations
	Date: Wed, 11 Jul 2001 06:02:17 -0500
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [email-masked] Wed Jul 11 06:02:22 2001
From: [email-masked]
To: [email-masked]
Subject: gcc-3.0 compilation with optimizations
Date: Wed, 11 Jul 2001 06:02:17 -0500

Full_Name: Guillaume Chazarain
Version: 2.4.0
CVS_Date: 
OS: linux-2.4.6-ac2
X_Server: XFree86-4.1.0
Submission from: (NULL) (134.59.9.99)

Hello, here is a patch for a bug that I suspect
not to be in fvwm.
Let me explain :
When compiling fvwm2 with gcc 3.0 under linux and
CFLAGS="-pipe -O2 -march=i686 -fomit-frame-pointer"
fvwm crashes at startup, the problem is that it
doesn't with older gcc or less aggressive optimizations.
So here is a dirty patch to fix this :
--------------------------------------------------------
diff -Naur fvwm-2.4.0/fvwm/builtins.c fvwm-2.4.0.gcc3/fvwm/builtins.c
--- fvwm-2.4.0/fvwm/builtins.c  Tue Jun 26 14:44:02 2001
+++ fvwm-2.4.0.gcc3/fvwm/builtins.c     Tue Jul 10 19:50:51 2001
@@ -1015,7 +1015,7 @@
   decor->flags.has_changed = 1;
   decor->titlebar.flags.has_changed = 1;
 
-  for (prev = action ; (parm = PeekToken(action, &action)); prev =
action)
+  for (prev = action ; (action && (parm = PeekToken(action, &action)));
prev = 
action)
   {
     if (!do_add && StrEquals(parm,"centered"))
     {
-------------------------------------------------------
The problem is that a NULL pointer is dereferenced.
Furthermore, I think this patch is not the solution, it's
just quick hack that lets me use gcc 3.0 and fvwm.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Lorenz Minder <[email-masked]>
Date: Fri, 13 Jul 2001 02:48:00 +0200

> So here is a dirty patch to fix this :

I can reproduce that problem with `-O2 -fomit-frame-pointer' (the -march
isn't necessary) and an empty fvwm2rc. It looks very much like a gcc-bug
indeed since the following non-sense modification `fixes' the problem as
well:

    for (prev = action ; (fprintf(stderr, "action==%p\n", action)!=0)
	    && (parm = PeekToken(action, &action)); prev = action)

Obviously, except for additional garbage output, that should not alter
the behaviour of the code, in theory.

The real fix is probably not to use -fomit-frame-pointer with gcc-3.0.

Greetings,
--Lorenz