Mail Archives: djgpp-workers/2001/06/21/07:06:16
On 21 Jun 2001, at 13:32, Eli Zaretskii wrote:
>
> On Thu, 21 Jun 2001 pavenis AT lanet DOT lv wrote:
>
> > > > + (void) id;
> > >
> > > Wait until GCC begins to bitch about "expression has no effect" ;-)
> >
> > At least it works with gcc-3.0 and earlier versions. I don't know what
> > will happen after some years. At least now it seems that explicitly
> > casting the result to void removes the warning
> > 'warning: statement with no effect'. What is said about this
> > in C standard?
>
> I don't think the standard has something about such warnings. However,
> many proprietary compilers, such as the ones from AIX and SGI, are very
> noisy about such code, and I'm not sure GCC maintainers think they
> shouldn't do the same, judging by the latest changes in warning policy.
Yes. However explicit casting to void silences warning at least for GCC
versions I tried and also for BCC 5.5 command line compiler
Andris
- Raw text -