emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several problems


From: Eli Zaretskii
Subject: Re: Several problems
Date: Sat, 02 Aug 2014 09:57:29 +0300

> From: Nicolas Avrutin <address@hidden>
> Date: Sat, 02 Aug 2014 00:10:08 -0400
> Cc: David Kastrup <address@hidden>, Faried Nawaz <address@hidden>,
>       address@hidden
> 
> Your patch fails to compile for me:
> frame.c: In function ‘make_initial_frame’:
> frame.c:863:40: error: lvalue required as left operand of assignment
>    FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
>                                         ^
> frame.c: In function ‘make_terminal_frame’:
> frame.c:916:40: error: lvalue required as left operand of assignment
>    FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
>                                         ^
> 
> 
> With your patch, FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) is defined to be
> false (the else branch, frame.h:858), resulting in the lines in frame.c
> macro expanding to false = false;

How can this happen?  The definition of
FRAME_HAS_HORIZONTAL_SCROLL_BARS on frame.h is this:

  #ifdef HAVE_WINDOW_SYSTEM

  /* This frame slot says whether scroll bars are currently enabled for frame F,
     and which side they are on.  */
  #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
    ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
  #define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
    ((f)->horizontal_scroll_bars)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
    ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
    ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)

  #else /* not HAVE_WINDOW_SYSTEM */

  /* If there is no window system, there are no scroll bars.  */
  #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((void) f, vertical_scroll_bar_none)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((void) f, 0)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) f, 0)
  #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) f, 0)
  #define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) ((void) f, 0)

  #endif /* HAVE_WINDOW_SYSTEM */

IOW, it is only defined as a constant zero when HAVE_WINDOW_SYSTEM is
_not_ defined.  Whereas line 863 of frame.c is this:

  #ifdef HAVE_WINDOW_SYSTEM
    f->vertical_scroll_bar_type = vertical_scroll_bar_none;
    FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
  #endif

IOW, it only treats FRAME_HAS_HORIZONTAL_SCROLL_BARS as an lvalue when
HAVE_WINDOW_SYSTEM _is_ defined.  And in that case, the definition of
FRAME_HAS_HORIZONTAL_SCROLL_BARS is not a constant.

So please look closer at your sources and try to figure out what
caused this strange problem.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]