🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1802

Re: problem with assertions

#1802
From: Shankar Unni
Date: Tue, 22 Aug 1995 08:17
24 lines
1547 bytes
J. Kanze (kanze@gabi-soft.fr) wrote:

> |>    BOOL
> |>       bSuccess = bTrySomething();

> Get a compiler that understands C++.  The ``declared but not used''
> warning is not applicable to objects;

Ah, but "bSuccess" is not an object: it's a bool. The declaration and
assignment to bSuccess is indeed superfluous if bSuccess is never used
again, as it has no effects unless bSuccess were a volatile..

If we're now saying that a compiler should *never* warn a user about
something which is declared but not used (or in this case, "set but not
used"), because in some cases the user *may* be doing something
"reasonable", then that's a different kettle of fish..
--
Shankar Unni				E-Mail:	shankar@sgi.com
Silicon Graphics Inc.			Phone:	+1-415-390-2072
URL:	http://reality.sgi.com/employees/shankar
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <41as14$d95@fido.asd.sgi.com>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <3vttrm$nc2@athena.ulaval.ca> <40fr11$2eu@gabi.gabi-soft.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 22 Aug 95 08:17:07 GMT
Approved: fjh@cs.mu.oz.au
Return-Path: <daemon@ncar.UCAR.EDU>
From: shankar@engr.sgi.com (Shankar Unni)
Newsgroups: comp.std.c++
Subject: Re: problem with assertions
X-Original-Date: 21 Aug 1995 20:58:12 GMT
Organization: Silicon Graphics, Inc.
Message-ID: <41as14$d95@fido.asd.sgi.com>
References: <3vttrm$nc2@athena.ulaval.ca> <40fr11$2eu@gabi.gabi-soft.fr>
Reply-To: shankar@engr.sgi.com
X-Newsreader: TIN [version 1.2 PL2]