Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA (COTTRELL, JAMES) Newsgroups: net.lang.c Subject: Uses of Short Message-ID: <1388@brl-tgr.ARPA> Date: Mon, 9-Sep-85 12:10:40 EDT Article-I.D.: brl-tgr.1388 Posted: Mon Sep 9 12:10:40 1985 Date-Received: Wed, 11-Sep-85 07:41:54 EDT Sender: news@brl-tgr.ARPA Lines: 26 /* Someone asked `what are the uses of short?' with specific interest in machines where `sizeof(short) = sizeof(int)' (he really means `==' :-) to which Guy Harris replies: `AAAAAAIIIIEEEEEEEEEE' followed by lots of words of wisdom. Except he didn't answer the question: `What *are* the uses of short?' I don't disagree with anything he said & I would sincerely like to hear his answer. `What are the stimuli that would provoke Guy to respond by typing `short' at the C compiler?' Perhaps the type short was conceived as a way to conveniently write machine *dependent* code, (such as getting at device registers) & create explicitly packed struxures for the nonportable parts of the operating system. If one is supplying the source code, then even such construx as the following will be portable with sufficient warning. #ifdef PARANOID typedef short small; #else typedef int small; OOPS! I got it backwards (I'm typing directly, no editor), make that `#ifndef'. The ANSI C std should help clear up matters as well. jim cottrell@nbs */ ------