🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7935

Re: What does this do?

#7935
From: Matthew Kirkwood
Date: Fri, 08 Mar 1996 01:44
32 lines
1609 bytes
On 5 Mar 1996, Chuck Kirschman wrote:

> I'm working in *somebody else's code*, which I'm sure everyone pretty
> much dreads.  I've run across a construct which I don't understand the
> purpose of:
> 
> void foo(int bar, float *baz)
> {
>   int x,y;
>   
>   (void) x;
>   (void) y;
>   
>   [rest of function]
> }
> 
> The compiler (Watcom 10.5) doesn't like it, but lets it pass.  What exactly
> is this doing?  And, more importantly, what is the author trying to acheive?

I'm not entirely sure, but I would guess that what he's trying to do is 
make the compiler know that x and y have been referenced by just 
evaulating them and ignoring the result.  I've no idea why he'd want to 
do this, except to disable 'Unreferenced local...' warnings, but then if 
the compiler complains at this, then it makes it seem entirely pointless.

Odd...

--
Matthew Kirkwood      |  Mail:  matthew.kirkwood@lmh.ox.ac.uk
LMH JCR,              |    or:  m95mtk@ecs.ox.ac.uk
Oxford OX2 6QA,       |  "There are no coincidences,
England.              |     But sometimes the pattern is more obvious."
Technical Details
Message-ID: <Pine.SUN.3.91.960308014236.6282B-100000@booth17.ecs>
Path: arc1-ca.pugleaf.net!booth17.ecs!m95mtk
References: <4hg4hv$iqb@hubcap.clemson.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!booth17.ecs!m95mtk
From: Matthew Kirkwood <m95mtk@booth17.ecs>
Newsgroups: comp.os.msdos.programmer,comp.lang.c
Subject: Re: What does this do?
Date: Fri, 8 Mar 1996 01:44:53 +0000
Organization: Oxford University
Message-ID: <Pine.SUN.3.91.960308014236.6282B-100000@booth17.ecs>
References: <4hg4hv$iqb@hubcap.clemson.edu>
NNTP-Posting-Host: booth17.ecs.ox.ac.uk
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
In-Reply-To: <4hg4hv$iqb@hubcap.clemson.edu>