Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>, jeffh@redhat.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFA] fix gdb.base/remote.c for small int targets
Date: Fri, 31 Aug 2001 08:29:00 -0000	[thread overview]
Message-ID: <1010831152902.ZM23264@ocotillo.lan> (raw)
In-Reply-To: <2110-Fri31Aug2001102556+0300-eliz@is.elta.co.il>

On Aug 31, 10:25am, Eli Zaretskii wrote:

> > +#if INT_MAX < 32768
> 
> Shouldn't you use 32768L or 32768U?  If an int is only 16 bits wide,
> 32768 might overflow into the sign bit, and then all bets are off.

Although not incorrect, using 32768L or 32768U is not necessary. 
According to section 7.11.1 of Harbison and Steele:

    Preprocessor constant expressions must be evaluated at compile
    time, and are subject to some relatively strict constraints.  Such
    expressions must have integral type, and can involve only integer
    constants, character constants, and the special defined operator. 
    All arithmetic is to be done using types long or unsigned long, as
    appropriate to the signedness of the operands, which frees the
    preprocessor from having to deal with several sizes of integer
    types.

Kevin


  reply	other threads:[~2001-08-31  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3B8EFA12.2010403@cygnus.com>
2001-08-30 22:11 ` Jeff Holcomb
2001-08-31  0:27   ` Eli Zaretskii
2001-08-31  8:29     ` Kevin Buettner [this message]
2001-08-31  9:01       ` Eli Zaretskii
2001-08-31  9:45         ` Kevin Buettner
2001-08-31 11:22           ` Eli Zaretskii
2001-08-31  8:30   ` Kevin Buettner
2001-09-03 12:55   ` [PATCH] " Jeff Holcomb

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=1010831152902.ZM23264@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sourceware.cygnus.com \
    --cc=jeffh@redhat.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox