[net.micro.att] Mult assgnmt in C stmnts on 7300

chute@dartvax.UUCP (Christopher Chute) (07/15/85)

I am yet again having simple minded problems with my 7300 that are surprising
to me.  It must be evident to all by now that I am not a programmer.  Still I
try.  My AT&T UNIX PC is a marvelous machine, however the compiler chokes,
coughs, and spits horribly on any statement that contains multiple assignment.
Below are some seleceted examples of programs from the net and othe sources
that must have worked somewhere:

    stat->exp = stat->lvl = stat->sin = 0;
    stat->blind = stat->vrg = stat->pal = FALSE;
    throne = beyond = marsh = FALSE;

and some very trivially more elaborate combinations:

    else    p_x = t_x = 0.0;
    Min[grindex] = Max[grindex] = datum;

I have been able to kludge them by exercising my brilliant grasp of programming
and breaking the statememts into discreet assignments.

QUESTION:  Are multiple assignments in a single statement allowed under the
Helsinki accord or is my C compiler (an AT&T I assume) just brain damaged?

Thanks,
Chris Chute MD
Dartmouth Medical School
{ihnp4, decvax}!dartvax!chute  OR
...!dartvax!chutepc!chute

greg@vecpyr.UUCP (Greg Millar) (07/16/85)

> coughs, and spits horribly on any statement that contains multiple assignment.
> 
>     stat->exp = stat->lvl = stat->sin = 0;
>     stat->blind = stat->vrg = stat->pal = FALSE;
>     throne = beyond = marsh = FALSE;
> 
> QUESTION:  Are multiple assignments in a single statement allowed under the
> Helsinki accord or is my C compiler (an AT&T I assume) just brain damaged?
> 

The Convergent Miniframe has the same problem (and a 7300 is a warmed over
and shrunk miniframe), so I suppose that cc bug hasn't been fixed yet.

You found the right work around though!

As a result of this bug, none of our code have multiple assignment statements.

		
			Greg Millar

			...{ucbvax,decwrl}!dual!vecpyr!greg
			Visual Engineering, Inc.  
			2680 N. First
			San Jose, CA 95134
			(408) 945-9055

mjs@eagle.UUCP (M.J.Shannon) (07/16/85)

> I am yet again having simple minded problems with my 7300 that are surprising
> to me.  My AT&T UNIX PC is a marvelous machine, however the compiler chokes,
> coughs, and spits horribly on any statement that contains multiple assignment.
> Below are some seleceted examples of programs from the net and othe sources
> that must have worked somewhere:
> 
>     stat->exp = stat->lvl = stat->sin = 0;
>     stat->blind = stat->vrg = stat->pal = FALSE;
>     throne = beyond = marsh = FALSE;
> 
> and some very trivially more elaborate combinations:
> 
>     else    p_x = t_x = 0.0;
>     Min[grindex] = Max[grindex] = datum;
> 
> QUESTION:  Are multiple assignments in a single statement allowed under the
> Helsinki accord or is my C compiler (an AT&T I assume) just brain damaged?
> 
> Chris Chute MD

Since I have a 7300 which has successfully compiled much of the software posted
to the net, my guess is that you have an early PC7300 with a pre-release
compiler.  What message does the compiler give for theses statements?

As to compiler brain damage, the compiler is *derived* from a pre-SystemV
compiler, and has apparently been modified significantly by Convergent
Technologies, who manufactured and packaged the box.  For instance, neither
the preprocessor nor the compiler proper allow FLEXNAMES (identifiers are
limited to 8 significant characters).

Side note: When illustrating errors, many of us who would try to help can be
more useful if the complainant provides full information, such as any error
messages produced, version of the program complaining (use /usr/bin/what on
/lib/ccom for compiler related things), etc.  In a word (or two), help us to
help you.

-- 
	Marty Shannon
UUCP:	ihnp4!eagle!mjs
Phone:	+1 201 522 6063