Re: Select case restrictions

From: Ron Shepard (ron-shepard_at_NOSPAM.comcast.net)
Date: 12/20/04


Date: Mon, 20 Dec 2004 10:37:28 -0600

In article <jvsds09r8kskkh9np64lr3u9v698b46ctp@4ax.com>,
 Herman D. Knoble <SkipKnobleLESS@SPAMpsu.DOT.edu> wrote:

> Question: Is it valid to input (or assign) a number x bigger
> than ik1 = selected_int_kind(2) ?

I'm not sure I'm replying to the question that you asked, but if it
is about the argument of selected_int_kind(), then suppose on a
particular computer that selected_int_kind(2) is the same as
selected_int_kind(9) or selected_int_kind(18). That is, suppose the
machine supported only 32-bit or 64-bit integers, and nothing
smaller. For that machine, I think it would be legal to read or
assign a number larger than 99. However, on a machine that
supported 8-bit integers, then assignment of values larger than 127
would fail. Note that the limit would be 127, the actual limit for
that data type, not 99, the requested limit. So I think the answer
is that it is legal, because a compiler is allowed to support larger
integers than requested, but nonportable, because it is not required
to support larger integers. If you want portability of the fortran
source code, then the assignments would have to be small enough to
fit within the requested range.

It has been discussed here in the past in c.l.f. that the
decimal-based requests are not consistent with the binary-based
actual data types. That is, if you want to assign values up to 127,
then there is no way to use selected_int_kind() to return an 8-bit
integer type that covers exactly that desired range of values. If
you request a 2-digit range, then the numbers between 100 and 127
would be outside of the requested range, but if you request a
3-digit range, the compiler is required to return a type that would
support values up to 999, which of course will not fit in an 8-bit
integer type, so a larger type would be returned. So in practice
you have to request the 2-digit integer type with
selected_int_kind(2), and trust that the compiler will return the
8-bit integer that you really want.

The proposed solutions to this problem have included additional
arguments to the selected_int_kind() function to specify either the
number of bits or to specify the base in which the number of digits
is to be interpreted.

$.02 -Ron Shepard



Relevant Pages

  • Whats in in the block git tree for 2.6.28?
    ... Support for handling online resizing of block devices. ... Adds block layer support for the 'discard' operation, ... By dropping it we can also shrink request ...
    (Linux-Kernel)
  • 2.6.0-test9 OOPS! kswapd0 exited with preempt_count 1
    ... This oops appears first and one time, when gzipping a directory in /tmp (ext3). ... Oct 30 05:06:31 djgera kernel: Unable to handle kernel paging request at virtual address 540092c4 ... Linux Plug and Play Support v0.97 Adam Belay ...
    (Linux-Kernel)
  • [RFC 0/6] bidi support: block, SCSI, and iSCSI layers
    ... Following are 6 patches that introduce support ... OSD tests are the ones who exercise BIDI I/O. ... extract io related fields in struct request into struct request_io_part ... use new API for accessing the new sub-structure ...
    (Linux-Kernel)
  • Re: [bug] latest -git boot hang
    ... 4ee5eaf: block: add a queue flag for request stacking support ... Adjust block device size after an online resize of a disk. ... Add BLKDISCARD ioctl to allow userspace to discard sectors ...
    (Linux-Kernel)
  • RE: File Download Warning Received when browsing to server name wi
    ... I used WFetch to get the following log as you requested. ... request took a long time and I had to abort it. ... > The "File Download" dialog is called by Internet Explorer. ... > Microsoft Product Support Services ...
    (microsoft.public.sharepoint.portalserver.development)