getc and "large" bytes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pete

    #31
    Re: getc and "large&quo t; bytes

    vippstar@gmail. com wrote:
    Is there any particular reason that you cast
    rc to (char) before you assign it to the buffer?
    My compiler warning level is set to "bitchy".

    The language does not require those (char) casts.

    --
    pete

    Comment

    • Chris Torek

      #32
      Re: getc and "large&quo t; bytes

      In article <mi7lg5xgpv.ln2 @news.flash-gordon.me.uk>
      Flash Gordon <spam@flash-gordon.me.ukwro te:
      >How about the 9bit machines people have mentioned in the past? Did they
      >have C implementations with binary streams fully supported?
      There was a C compiler for the Univac in the basement, back
      when I was at the University of Maryland. The Univac had
      9-bit char, 18-bit short, 36-bit long.

      I never used it though (the C compiler, I mean -- I barely ever
      used the Univac, except as required for a few courses). I expect
      it worked pretty much the same way as other ASCII-based systems on
      that machine: there was a file format using "quarterwor ds" (9-bit
      "bytes"; the native Univac "bytes" were 6-bit FIELDATA text), and
      in general people just avoided setting the topmost bit(s). If you
      *did* set the topmost bits, you got non-ASCII data in your "ASCII"
      files, and it would transfer OK as long as you stayed "inside" the
      Univac system, but bits 7 and 8 would disappear in various kinds
      of I/O (because "quarterwor d" data would get transferred in 7 or
      8 bit units to external hardware that worked in "anything other
      than FIELDATA").

      Systems with wildly different internal and external data representations
      *do* teach one to learn about "internaliz ing" and "externaliz ing"
      data, at least. :-)
      --
      In-Real-Life: Chris Torek, Wind River Systems
      Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
      email: gmail (figure it out) http://web.torek.net/torek/index.html

      Comment

      • lawrence.jones@siemens.com

        #33
        Re: getc and &quot;large&quo t; bytes

        Richard Tobin <richard@cogsci .ed.ac.ukwrote:
        >
        Are all possible unsigned char values required to be characters that
        can be written and read?
        Yes.

        -- Larry Jones

        But Mom, frogs are our FRIENDS! -- Calvin

        Comment

        Working...