comparison dmd/statement.c @ 215:a58d8f4b84df trunk

[svn r231] Changed: warnings are no longer treated as an error. Added some comments and cleaned up CallExp::toElem a tiny bit. Fixed: struct literals always reported inplace assignment even if they allocated a temporary. Fixed: passing stuff to a D-style vararg which did inplace assignment was generated suboptimal code.
author lindquist
date Tue, 03 Jun 2008 13:51:09 +0200
parents 5acec6b2eef8
children 092468448d25
comparison
equal deleted inserted replaced
214:629cfc1e7b77 215:a58d8f4b84df
529 if (!s) 529 if (!s)
530 continue; 530 continue;
531 531
532 if (!falloff && global.params.warnings && !s->comeFrom()) 532 if (!falloff && global.params.warnings && !s->comeFrom())
533 { 533 {
534 fprintf(stdmsg, "warning - "); 534 warning("%s: statement is not reachable", s->loc.toChars());
535 s->error("statement is not reachable");
536 } 535 }
537 falloff = s->fallOffEnd(); 536 falloff = s->fallOffEnd();
538 } 537 }
539 return falloff; 538 return falloff;
540 } 539 }
2047 2046
2048 if (!sc->sw->sdefault) 2047 if (!sc->sw->sdefault)
2049 { hasNoDefault = 1; 2048 { hasNoDefault = 1;
2050 2049
2051 if (global.params.warnings) 2050 if (global.params.warnings)
2052 { fprintf(stdmsg, "warning - "); 2051 { warning("%s: switch statement has no default", loc.toChars());
2053 error("switch statement has no default");
2054 } 2052 }
2055 2053
2056 // Generate runtime error if the default is hit 2054 // Generate runtime error if the default is hit
2057 Statements *a = new Statements(); 2055 Statements *a = new Statements();
2058 CompoundStatement *cs; 2056 CompoundStatement *cs;