GCC 4.6

Iain Buclaw ibuclaw at ubuntu.com
Sun Mar 27 07:03:14 PDT 2011


> test.d(4): Error: + has no effect in expression (x + y)
> But currently this gives no errors, despite it's the same situation, so I'd like
an error here too (this enhancement request is in Bugzilla already):
> pure int add(int a, int b) { return a + b; }
> void main() {
>     int x = 10;
>     int y = 20;
>     add(x, y);
> }

I think it would be better if it were targeting memory/(re)allocation-related
functions.

ie:
{
  new int[4096];  // allocation has no effect, other than leaking memory.
}



More information about the Digitalmars-d mailing list