[comp.sys.amiga.tech] Aztec 5.0

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (02/03/90)

In <6285@cps3xx.UUCP>, griffin@frith.egr.msu.edu writes:
>In an article Karl Lehenbauer [Organization: Sugar Land Unix - Houston]
>writes:
>
>> This will work with old-style K&R declarations as well.  Here is where I
>> found the only bug I've found so far -- it wrote into the prototype file
>> a parameter of "int foo" when the K&R-style argument was
>> "register char *foo".
>
>ANSI requires that taking of the address of 'register' is always an error,
>even if the object is placed in addressable memory.  Older versions of
>Aztec C would ignore the 'register'.

Hmmm... where is the 'address of register' in that declaration? I see a char
(*foo), a pointer (foo), and foo is in a register.

I tend to have to struggle with C, but I thought I had that bit down pat. If
you are correct, then I will have to do some concept adjustments.

-larry

--
  This life is a test. It is only a test. If this had been a real life,
  you would have been told where to go and what to do.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

griffin@frith.egr.msu.edu (02/04/90)

In an article Karl Lehenbauer [Organization: Sugar Land Unix - Houston]
writes:

> This will work with old-style K&R declarations as well.  Here is where I
> found the only bug I've found so far -- it wrote into the prototype file
> a parameter of "int foo" when the K&R-style argument was
> "register char *foo".

ANSI requires that taking of the address of 'register' is always an error,
even if the object is placed in addressable memory.  Older versions of
Aztec C would ignore the 'register'.




Dan Griffin
griffin@frith.egr.msu.edu		"We're waiting for Godot..."

dougp@voodoo.ucsb.edu (02/04/90)

-Message-Text-Follows-
In article <6285@cps3xx.UUCP>, griffin@frith.egr.msu.edu writes...
>In an article Karl Lehenbauer [Organization: Sugar Land Unix - Houston]
>writes:
> 
>> "register char *foo".
> 
>ANSI requires that taking of the address of 'register' is always an error,

Look again: he has a register variable which contains a pointer to a 
char. He has not taken the address of a register, he has an address in
a register.

Douglas Peale

peter@sugar.hackercorp.com (Peter da Silva) (02/05/90)

In article <6285@cps3xx.UUCP> griffin@frith.egr.msu.edu () writes:
> In an article Karl Lehenbauer [Organization: Sugar Land Unix - Houston]
> writes:
> > This will work with old-style K&R declarations as well.  Here is where I
> > found the only bug I've found so far -- it wrote into the prototype file
> > a parameter of "int foo" when the K&R-style argument was
> > "register char *foo".

> ANSI requires that taking of the address of 'register' is always an error,

That's fine, but "register char *foo;" is a legal declaration: a pointer
stored in a register. Whether having a "register" declaration on a parameter
is legal or not (I don't have my copy of the draft here, but I think it is)
is another matter: but converting the declaration ot "int" is still a bug.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'