Subject: It's that DARN "&class" that's got me! Help with Compiler Warning

From: "Madden-1, Joe" <[email-masked]>
Date: Tue, 12 Nov 1996 10:22:17 -0500

Hello List Watchers,

I am trying to compile the 2.4.2.-BETA-11 version on a DEC Alpha 2100
running Digital Unix 4.0.  While compiling access.c my DEC (cc) compiler
generated the following warning:

Warning: access.c, line 366: In this statement, & before array "class"
ignored.
memset((void *)&class, 0, sizeof(class));
-----------------------^

With regards to the code, I must say that I am unfamiliar with this
particular construct.  Does the author wish to define a pointer to a
pointer or was the inclusion of the "&" an oversight?  Looking at the
memset() function, the first argument must be a pointer so I understand
the typecast to void pointer.  It's that darn &class that's got me!

Any help from anyone would be beneficial.  I am not subscribed to the
list so please reply directly to me.  Thanks a million in advance...Joe

---

From: "James L. McGill" <[email-masked]>
Date: Thu, 14 Nov 1996 08:47:38 -0600 (CST)

On Tue, 12 Nov 1996, Madden-1, Joe wrote:

> Date: Tue, 12 Nov 1996 10:22:17 -0500
> From: "Madden-1, Joe" <[email-masked]>
> Reply-To: [email-masked]
> To: "[email-masked]'" <[email-masked]>
> Subject: It's that DARN "&class" that's got me! Help with Compiler Warning
> 
> Hello List Watchers,
> 
> Does the author wish to define a pointer to a
> pointer or was the inclusion of the "&" an oversight?
 
Looking only at this, the expression is only taking the
address of class and casting it as a pointer to void type.

The only way this would be a "pointer to a pointer" is if
class is already a reference to something.  

Is it the typecast (void *) that has confused you?

James