Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: geert@linux-m68k.org
Cc: jack@suse.cz, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-cris-kernel@axis.com
Subject: Re: size_t/ssize_t warnings (was: Re: Build regressions/improvements in v3.5-rc5)
Date: Fri, 6 Jul 2012 15:45:55 +0200	[thread overview]
Message-ID: <201207061345.q66DjtJl016985@ignucius.se.axis.com> (raw)
In-Reply-To: <CAMuHMdU+GdPnEgdJJFezPET5y4Q0-fqBJZZZ1cNZyPOG6_d4Ug@mail.gmail.com> (message from Geert Uytterhoeven on Fri, 6 Jul 2012 09:18:52 +0200)

> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Date: Fri, 6 Jul 2012 09:18:52 +0200

> On Fri, Jul 6, 2012 at 3:12 AM, Hans-Peter Nilsson
> <hans-peter.nilsson@axis.com> wrote:
> > Um, no, ssize_t isn't long.  Do you mean __kernel_ssize_t?
> 
> In the kernel, (s)size_t == __kernel_(s)size_t

Right, sorry for being slow.

> OK, so (s)size_t should be (unsigned) int for Linux.

Both the the kernel and userspace, yes.

> Probably the "long" dates from the time people used cris-axis-elf
> instead of cris-axis-linux-gnu, and "__SIZE_TYPE" from the time
> people started using cris-axis-linux-gnu?

I don't remember.  I have a vague recollection of a change in
the distant past.

> Ah, yes, commit ac505a9fd19c99fdb622fe4896446f995151babc
> ("[PATCH] CRIS architecture update for 2.5.74") in full-history-linux
> changed size_t from "unsigned long" to __SIZE_TYPE, but didn't
> update ssize_t. Probably "signed __SIZE_TYPE" doesn't work?

Well no.  Remember here it's "unsigned int": "signed unsigned
int" doesn't compile very well.

> So I guess they should be changed to (explicit) "unsigned int", resp.
> "int". Or does it make sense to retain __SIZE_TYPE?

I think it'd make sense to use __SIZE_TYPE__ (don't forget the
trailing "__") for *all* targets that don't have a particular
difference between kernel and userspace ABI's (notable
exceptions being those with use 32-bit user and 64-bit kernel
ABIs).  Unfortunately, there's no __SSIZE_TYPE__.

brgds, H-P

      reply	other threads:[~2012-07-06 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 20:17 size_t/ssize_t warnings (was: Re: Build regressions/improvements in v3.5-rc5) Geert Uytterhoeven
2012-07-05  1:25 ` Mike Frysinger
2012-07-06  1:12 ` Hans-Peter Nilsson
2012-07-06  7:18   ` Geert Uytterhoeven
2012-07-06 13:45     ` Hans-Peter Nilsson [this message]

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=201207061345.q66DjtJl016985@ignucius.se.axis.com \
    --to=hans-peter.nilsson@axis.com \
    --cc=geert@linux-m68k.org \
    --cc=jack@suse.cz \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox