[EMAIL PROTECTED] wrote:
> 
> 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.


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
--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to