Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!masscomp!ftw From: ftw@masscomp.UUCP (Farrell Woods) Newsgroups: comp.lang.c Subject: Re: AT&T C compilers Summary: ATT C supports anachronisims Keywords: ATT, anachronisims, =op Message-ID: <806@masscomp.UUCP> Date: 4 Mar 89 18:13:39 GMT References: <569@marob.MASA.COM> <1071@auspex.UUCP> <1109@wpi.wpi.edu> <9761@smoke.BRL.MIL> <1187@wpi.wpi.edu> Reply-To: ftw@quasar.masscomp.UUCP (Farrell Woods) Organization: Concurrent Computer Corporation - Westford, Ma Lines: 31 In article <1187@wpi.wpi.edu> lfoard@wpi.wpi.edu (Lawrence C Foard) writes: >Yes it does [barf]. The c compiler that came with the system VS Gnu-c [example deleted] >Maybe WPI is just brain damaged :) but so far every UNIX system I have seen >here has this problem, so far every PC C compiler has not. Atleast UNIX could >have implemented the ANSI Prototypes and gotten rid of this bug. This summer I >had to write a program that converted ANSI style C to old fashioned C so it >could be run on an HP workstation, the time saved by using ANSI prototypes was >worth the effort. Actually it doesn't matter if 'A' is a char or integer it >will get casted into whatever is needed any ways. Two things: First, your script points out that whatever Unix compiler you're using supports the old-fashioned =op, and that gcc does not. Note that since the operators and operands are jammed together (i.e., no whitespace), the compiler has no clue that perhaps you really meant "p = -1;". The tokenizer grabbed the longest token first (in your case, it grabbed "=-" as a single token. At least you got a warning, but the behavior is not incorrect, since it is not pANS compliant. Second, prototypes have nothing to do with this, nor do they have anything to do with assignments of character constants (which we all know now ints ;-) ) to chars. This is just a narrowing assignment. -- Farrell T. Woods Voice: (508) 392-2471 Concurrent Computer Corporation Domain: ftw@masscomp.com 1 Technology Way uucp: {backbones}!masscomp!ftw Westford, MA 01886 OS/2: Half an operating system