🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: problem with assertions

#1766
From: J. Kanze
Date: Tue, 15 Aug 1995 02:41
31 lines
1571 bytes
STIOO (stioo@ift.ulaval.ca) wrote:
|>    ...
|>
|>    BOOL
|>       bSuccess = bTrySomething();

|>    assert(bSuccess);   // I kwnow it must be a success.

|>    ...


|>    When I remove the assert statement  (undefining a keyword) I get
|> a compiler warning: "bSuccess declared but not used".

|>    Is there another writing style that avoids such a message?

Get a compiler that understands C++.  The ``declared but not used''
warning is not applicable to objects; the compiler should know enough to
not generate it if the object has a constructor or a destructor.

While waiting: pipe the compiler output through grep -v 'declared but
not used'.
--
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
--Beratung in industrieller Datenverarbeitung
---
[ 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: <40fr11$2eu@gabi.gabi-soft.fr>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
References: <3vttrm$nc2@athena.ulaval.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 15 Aug 95 02:41:04 GMT
Approved: fjh@cs.mu.oz.au
Return-Path: <daemon@ncar.UCAR.EDU>
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.std.c++
Subject: Re: problem with assertions
X-Original-Date: 11 Aug 1995 16:55:29 +0200
Organization: GABI Software, Sarl.
Message-ID: <40fr11$2eu@gabi.gabi-soft.fr>
References: <3vttrm$nc2@athena.ulaval.ca>
X-Newsreader: TIN [version 1.2 PL2]