AT&T C compilers

Lawrence C Foard lfoard at wpi.wpi.edu
Sat Mar 4 17:43:42 AEST 1989


In article <9761 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>>Standard UNIX C still barfs on things like p=-1 .
>
>No, it doesn't.

Yes it does. The c compiler that came with the system VS Gnu-c

Script started on Sat Mar  4 02:32:12 1989
% cat tmp.c
main()
 {
  int p=2;
  p=-1;
  printf("%d\n",p);
 }
% cc tmp.c
"tmp.c", line 4: warning: old-fashioned assignment operator
% a.out
1
% gcc tmp.c
% a.out
-1
% exit
script done on Sat Mar  4 02:32:36 1989

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. 
-- 
/----------------------------------------------------------------------------\
| My opinions are violently objected to by my employer. I was fired last year|
| but they forgot to remove my account. Lawrence Foard (entropy)             |
\----------------------------------------------------------------------------/



More information about the Comp.lang.c mailing list