From 1613708395851083093
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,857007135a18bc05
X-Google-Attributes: gidf78e5,public
From: Francis Glassborow <francis@robinton.demon.co.uk>
Subject: Re: static_cast to void
Date: 1999/09/11
Message-ID: <WwJQQZA6Jj23EwF3@robinton.demon.co.uk>#1/1
X-Deja-AN: 523818322
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <M-MORITA.99Sep9141115@pdss7.trc.rwcp.or.jp> <slrn7tgtbq.8tp.sbnaran@localhost.localdomain>
X-UID: 0000000001
X-Status: $$$T
Organization: Southfield Microcomputer SS
Mime-Version: 1.0
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <slrn7tgtbq.8tp.sbnaran@localhost.localdomain>, Siemel B.
Naran <sbnaran@uiuc.edu> writes
>Sometimes you write expressions that return a value, but you don't use
>this returned value.  Then the compiler may give you a warning about
>the unused return value.  To shut off these warnings, put a "(void)"
>at the beginning of the line.  For example,

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);


Francis Glassborow      Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation


[ 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              ]




