From -4477206025524418426
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,857007135a18bc05
X-Google-Attributes: gidf78e5,public
From: James.Kanze@dresdner-bank.com
Subject: Re: static_cast to void
Date: 1999/09/13
Message-ID: <7rip2t$fvt$1@nnrp1.deja.com>#1/1
X-Deja-AN: 524543397
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <M-MORITA.99Sep9141115@pdss7.trc.rwcp.or.jp> <slrn7tgtbq.8tp.sbnaran@localhost.localdomain> <WwJQQZA6Jj23EwF3@robinton.demon.co.uk> <MPG.1244c6ff5b182d6e9896a9@news.mindspring.com>
X-Original-Date: Mon, 13 Sep 1999 12:01:38 GMT
X-Http-User-Agent: Mozilla/4.06 [de] (WinNT; I)
X-Complaints-To: news@news.unimelb.edu.au
X-Http-Proxy: 1.0 x41.deja.com:80 (Squid/1.1.22) for client 193.194.7.84
X-Trace: ariel.ucs.unimelb.edu.au 937243783 25082 128.250.37.153 (13 Sep 1999 17:29:43 GMT)
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Mon Sep 13 12:01:38 1999 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN900buEDnX0m9pzZAQEGxwF+J3m1BYcDnlVeISjVGFGLouATv0PaUUMT qnP8JMTuQIIqbB2R+swmZGoCzP8dzsdG =vmUI
X-MyDeja-Info: XMYDJUIDkanze
NNTP-Posting-Date: 13 Sep 1999 17:29:43 GMT
Newsgroups: comp.std.c++

In article <MPG.1244c6ff5b182d6e9896a9@news.mindspring.com>,
  jcoffin@taeus.com (Jerry Coffin) wrote:
>
> In article <WwJQQZA6Jj23EwF3@robinton.demon.co.uk>,
> francis@robinton.demon.co.uk says...
>
> [ ... ]

> > Do such compilers exist in the real world?  Because if so they must
> > be exceptionally noisy.  Strictly speaking they should warn me for:

> > cout << 1;

> > as I will have ignore the return value of:

> > operator << (cout, 1);
>
> ...not to mention for such things as:
>
> 	x = 1;

> since this yields (not returns, since there's no function call) a
> value of 1...

> In all honesty, I've never seen (or heard of) a compiler with such
> stupid warnings, but I've seen at least one version of lint that did.

This is the second mention of lint I've seen here.  The lint I remember
looked at the entire program (not just a module), and complained if the
return value of a function was used in some places, and not in others.

This was before there was a void type, and the warning was useful --
most of the time, it meant that you were trying to use a return value
from a function which didn't have one (but was implicitly int anyway).

And it didn't warn for cases like x = 1.

--
James Kanze                   mailto: James.Kanze@dresdner-bank.com
Conseils en informatique orient�e objet/
                  Beratung in objekt orientierter Datenverarbeitung
Ziegelh�ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



