This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
FWD: Re: Your Message Sent on Sat, 29 Dec 2001 16:28:56 -0500
- From: "Jeffrey Turner" <jturner at mail dot alum dot rpi dot edu>
- To: <nathan at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>, <law at gcc dot gnu dot org>, <dosreis at cmla dot ens-cachien dot fr>
- Date: Sat, 29 Dec 2001 20:31:54 -0500
- Subject: FWD: Re: Your Message Sent on Sat, 29 Dec 2001 16:28:56 -0500
- Reply-to: <jturner at mail dot alum dot rpi dot edu>
---------- Original Message ----------------------------------
From: Bjarne Stroustrup <bs@research.att.com>
Reply-To: Bjarne Stroustrup <bs@research.att.com>
Date: Sat, 29 Dec 2001 16:51:06 -0500 (EST)
>Date: Sat, 29 Dec 2001 16:28:56 -0500
>Mime-Version: 1.0
>From: "Jeffrey Turner" <jturner@mail.alum.rpi.edu>
>To: <bs@day.research.att.com>
>
>Dear Mr. Stroustrup,
>
>This question came up recently on a gcc mailing list.
>Is there a C++ way to cast something to a void?
>Gcc will, reasonably enough give a warning for
>
> (void) foo
>
>if "-Wold-style-casts" is in the command-line.
>Can it be done with <xxxxxxx_cast>s?
Sure:
static_cast<void>(e);
is ok for any valid expression e. (standard 5.2.9[4])
>Thanks again,
>
>--Jeff Turner
>
>Who put the Sam in the "'Sama Laden Ding-Dong"?
>
- Bjarne
Bjarne Stroustrup, http://www.research.att.com/~bs