all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Glenn Morris <rgm@gnu.org>, emacs-devel@gnu.org
Subject: Re: warning compiling dbusbind.c
Date: Thu, 24 Jan 2008 16:25:22 -0500	[thread overview]
Message-ID: <jwvy7aeapih.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87prvr7zvt.fsf@gmx.de> (Michael Albinus's message of "Thu, 24 Jan 2008 21:05:42 +0100")

> I've used make_fixnum_or_float, because BITS_PER_EMACS_INT is too small
> on 32bit machines. One possible solution could be

> 	dbus_uint32_t val;
> 	dbus_message_iter_get_basic (iter, &val);
> 	XD_DEBUG_MESSAGE ("%c %d", dtype, val);
> #if BITS_PER_EMACS_INT >= 32
> 	return make_number (val);
> #else
> 	return make_fixnum_or_float (val);
> #endif

Yuck.  I must prefer living with the warning (which is just that:
a warning.  We already have several similar ones).

> On the other hand, shouldn't it be handled in make_fixnum_or_float?

No, because make_fixnum_or_float expects an integer of type EMACS_INT.
The problem here is that you pass it an object that is slight smaller,
so soome of its internal code cann be optimized away, which is what the
compiler warns you about.  Maybe casting val to EMACS_INT is enough to
silence the compiler?

I wonder if gcc would also complain  in the case where
make_fixnum_or_float is an inlinable function.  I'd guess not.


        Stefan

  reply	other threads:[~2008-01-24 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 19:18 warning compiling dbusbind.c Glenn Morris
2008-01-24 20:05 ` Michael Albinus
2008-01-24 21:25   ` Stefan Monnier [this message]
2008-01-24 22:33     ` Glenn Morris
2008-01-24 23:20       ` Nick Roberts
2008-01-25  2:19         ` Stefan Monnier
2008-01-25 19:04       ` Michael Albinus
2008-01-25 22:42         ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy7aeapih.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.