unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Broken dbusbind.c
@ 2020-12-28 17:50 John Yates
  2020-12-29  0:40 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: John Yates @ 2020-12-28 17:50 UTC (permalink / raw)
  To: Emacs developers

I am trying to build the last tip.  I get compile errors in dbusbind.c.
The culprit is a broken macro definition:

/* Check whether TYPE is a basic DBusType.  */
#ifdef HAVE_DBUS_TYPE_IS_VALID
#define XD_BASIC_DBUS_TYPE(type) \
  (dbus_type_is_valid (type) && dbus_type_is_basic (type))
#else
#define XD_BASIC_DBUS_TYPE(type) \  <<<< definition must be a single
logical line
  ((type == DBUS_TYPE_BYTE) \
   || (type == DBUS_TYPE_BOOLEAN) \
   || (type == DBUS_TYPE_INT16) \
   || (type == DBUS_TYPE_UINT16) \
   || (type == DBUS_TYPE_INT32) \
   || (type == DBUS_TYPE_UINT32) \
   || (type == DBUS_TYPE_INT64) \
   || (type == DBUS_TYPE_UINT64) \
   || (type == DBUS_TYPE_DOUBLE) \
   || (type == DBUS_TYPE_STRING) \
   || (type == DBUS_TYPE_OBJECT_PATH) \
   || (type == DBUS_TYPE_SIGNATURE) \
#ifdef DBUS_TYPE_UNIX_FD             <<<< Oops!
   || (type == DBUS_TYPE_UNIX_FD) \
#endif
   )
#endif



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-28 17:50 Broken dbusbind.c John Yates
@ 2020-12-29  0:40 ` Lars Ingebrigtsen
  2020-12-29  2:57   ` John Yates
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-29  0:40 UTC (permalink / raw)
  To: John Yates; +Cc: Emacs developers

John Yates <john@yates-sheets.org> writes:

> I am trying to build the last tip.  I get compile errors in dbusbind.c.
> The culprit is a broken macro definition:

You don't specify the OS this breaks on -- the current Emacs trunk
builds fine for me on Debian bullseye, for instance.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-29  0:40 ` Lars Ingebrigtsen
@ 2020-12-29  2:57   ` John Yates
  2020-12-29 20:20     ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: John Yates @ 2020-12-29  2:57 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Emacs developers

On Mon, Dec 28, 2020 at 7:40 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> You don't specify the OS this breaks on -- the current Emacs trunk
> builds fine for me on Debian bullseye, for instance.

Here is more context:

/* Check whether TYPE is a basic DBusType.  */
#ifdef HAVE_DBUS_TYPE_IS_VALID
#define XD_BASIC_DBUS_TYPE(type) \
  (dbus_type_is_valid (type) && dbus_type_is_basic (type))
#else
#define XD_BASIC_DBUS_TYPE(type) \
  ((type == DBUS_TYPE_BYTE) \
   || (type == DBUS_TYPE_BOOLEAN) \
   || (type == DBUS_TYPE_INT16) \
   || (type == DBUS_TYPE_UINT16) \
   || (type == DBUS_TYPE_INT32) \
   || (type == DBUS_TYPE_UINT32) \
   || (type == DBUS_TYPE_INT64) \
   || (type == DBUS_TYPE_UINT64) \
   || (type == DBUS_TYPE_DOUBLE) \
   || (type == DBUS_TYPE_STRING) \
   || (type == DBUS_TYPE_OBJECT_PATH) \
   || (type == DBUS_TYPE_SIGNATURE) \
#ifdef DBUS_TYPE_UNIX_FD
   || (type == DBUS_TYPE_UNIX_FD) \
#endif
   )
#endif

Notice that, if HAVE_DBUS_TYPE_IS_VALID is defined
we get the first #define XD_BASIC_DBUS_TYPE and
all will be well.

OTOH, if HAVE_DBUS_TYPE_IS_VALID is undefined
we get the broken #define.  (Imagine what the C lexer
sees when each \<NL> disappears.  The result is a line
with a #ifdef DBUS_TYPE_UNIX_FD tacked onto the
end.)

My sense is that the OS is immaterial.  Is not the
HAVE_DBUS_TYPE_IS_VALID symbol supplied by
the configure script?  Hence it comes down to what
headers and libraries have been installed.

(For what it is worth I am on Ubuntu 20.10.)

/john



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-29  2:57   ` John Yates
@ 2020-12-29 20:20     ` Michael Albinus
  2020-12-30  9:52       ` Michael Albinus
  2020-12-30 19:15       ` John Yates
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Albinus @ 2020-12-29 20:20 UTC (permalink / raw)
  To: John Yates; +Cc: Lars Ingebrigtsen, Emacs developers

John Yates <john@yates-sheets.org> writes:

Hi John,

> Here is more context:
>
> /* Check whether TYPE is a basic DBusType.  */
> #ifdef HAVE_DBUS_TYPE_IS_VALID
> #define XD_BASIC_DBUS_TYPE(type) \
>   (dbus_type_is_valid (type) && dbus_type_is_basic (type))
> #else
> #define XD_BASIC_DBUS_TYPE(type) \
>   ((type == DBUS_TYPE_BYTE) \
>    || (type == DBUS_TYPE_BOOLEAN) \
>    || (type == DBUS_TYPE_INT16) \
>    || (type == DBUS_TYPE_UINT16) \
>    || (type == DBUS_TYPE_INT32) \
>    || (type == DBUS_TYPE_UINT32) \
>    || (type == DBUS_TYPE_INT64) \
>    || (type == DBUS_TYPE_UINT64) \
>    || (type == DBUS_TYPE_DOUBLE) \
>    || (type == DBUS_TYPE_STRING) \
>    || (type == DBUS_TYPE_OBJECT_PATH) \
>    || (type == DBUS_TYPE_SIGNATURE) \
> #ifdef DBUS_TYPE_UNIX_FD
>    || (type == DBUS_TYPE_UNIX_FD) \
> #endif
>    )
> #endif
>
> Notice that, if HAVE_DBUS_TYPE_IS_VALID is defined
> we get the first #define XD_BASIC_DBUS_TYPE and
> all will be well.
>
> OTOH, if HAVE_DBUS_TYPE_IS_VALID is undefined
> we get the broken #define.  (Imagine what the C lexer
> sees when each \<NL> disappears.  The result is a line
> with a #ifdef DBUS_TYPE_UNIX_FD tacked onto the
> end.)

Might be. However, ...

> (For what it is worth I am on Ubuntu 20.10.)

... I'm also testing on Ubuntu 20.10. Why is HAVE_DBUS_TYPE_IS_VALID
undefined for you?

> /john

Best regards, Michael.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-29 20:20     ` Michael Albinus
@ 2020-12-30  9:52       ` Michael Albinus
  2020-12-30 19:15       ` John Yates
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2020-12-30  9:52 UTC (permalink / raw)
  To: John Yates; +Cc: Lars Ingebrigtsen, Emacs developers

Michael Albinus <michael.albinus@gmx.de> writes:

Hi John,

>> OTOH, if HAVE_DBUS_TYPE_IS_VALID is undefined
>> we get the broken #define.  (Imagine what the C lexer
>> sees when each \<NL> disappears.  The result is a line
>> with a #ifdef DBUS_TYPE_UNIX_FD tacked onto the
>> end.)

I've fixed this in master.

>> (For what it is worth I am on Ubuntu 20.10.)
>
> ... I'm also testing on Ubuntu 20.10. Why is HAVE_DBUS_TYPE_IS_VALID
> undefined for you?

This is still not clear to me; I'm curious about.

>> /john

Best regards, Michael.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-29 20:20     ` Michael Albinus
  2020-12-30  9:52       ` Michael Albinus
@ 2020-12-30 19:15       ` John Yates
  2020-12-31  9:00         ` Michael Albinus
  1 sibling, 1 reply; 8+ messages in thread
From: John Yates @ 2020-12-30 19:15 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Lars Ingebrigtsen, Emacs developers

On Tue, Dec 29, 2020 at 3:21 PM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Why is HAVE_DBUS_TYPE_IS_VALID
> undefined for you?

I do not know.  I have a random collection of -dev packages
installed which I have been determined empirically over time
be needed to build the projects I track.  I do not know what
feature configure tests for when deciding whether or not to
define HAVE_DBUS_TYPE_IS_VALID.  Do you?

That said, the #else clause is clearly broken.  Do you agree?
If not then I challenge you do force its use and see that the
result does not compile.

/john



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-30 19:15       ` John Yates
@ 2020-12-31  9:00         ` Michael Albinus
  2020-12-31 16:04           ` John Yates
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2020-12-31  9:00 UTC (permalink / raw)
  To: John Yates; +Cc: Lars Ingebrigtsen, Emacs developers

John Yates <john@yates-sheets.org> writes:

Hi John,

>> Why is HAVE_DBUS_TYPE_IS_VALID
>> undefined for you?
>
> I do not know.  I have a random collection of -dev packages
> installed which I have been determined empirically over time
> be needed to build the projects I track.  I do not know what
> feature configure tests for when deciding whether or not to
> define HAVE_DBUS_TYPE_IS_VALID.  Do you?

# pkg-config --cflags dbus-1
-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include

> That said, the #else clause is clearly broken.  Do you agree?
> If not then I challenge you do force its use and see that the
> result does not compile.

You might have seen that I did it already yesterday, as said in the
other message.

> /john

Best regards, Michael.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Broken dbusbind.c
  2020-12-31  9:00         ` Michael Albinus
@ 2020-12-31 16:04           ` John Yates
  0 siblings, 0 replies; 8+ messages in thread
From: John Yates @ 2020-12-31 16:04 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Lars Ingebrigtsen, Emacs developers

On Thu, Dec 31, 2020 at 4:00 AM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> You might have seen that I did it already yesterday, as said in the
> other message.

Missed that.  My bad.  Thank you.

/john



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-31 16:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 17:50 Broken dbusbind.c John Yates
2020-12-29  0:40 ` Lars Ingebrigtsen
2020-12-29  2:57   ` John Yates
2020-12-29 20:20     ` Michael Albinus
2020-12-30  9:52       ` Michael Albinus
2020-12-30 19:15       ` John Yates
2020-12-31  9:00         ` Michael Albinus
2020-12-31 16:04           ` John Yates

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).