comparison dmd/func.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 1856c62af24b
children d61ce72c39ab
comparison
equal deleted inserted replaced
214:629cfc1e7b77 215:a58d8f4b84df
306 if (fdv->isFinal()) 306 if (fdv->isFinal())
307 error("cannot override final function %s", fdv->toPrettyChars()); 307 error("cannot override final function %s", fdv->toPrettyChars());
308 308
309 #if V2 309 #if V2
310 if (!isOverride() && global.params.warnings) 310 if (!isOverride() && global.params.warnings)
311 error("overrides base class function %s, but is not marked with 'override'", fdv->toPrettyChars()); 311 warning("%s: overrides base class function %s, but is not marked with 'override'", locToChars() fdv->toPrettyChars());
312 #endif 312 #endif
313 313
314 if (fdv->toParent() == parent) 314 if (fdv->toParent() == parent)
315 { 315 {
316 // If both are mixins, then error. 316 // If both are mixins, then error.
1054 { 1054 {
1055 if (offend) 1055 if (offend)
1056 { Expression *e; 1056 { Expression *e;
1057 1057
1058 if (global.params.warnings) 1058 if (global.params.warnings)
1059 { fprintf(stdmsg, "warning - "); 1059 { warning("%s: no return at end of function", locToChars());
1060 error("no return at end of function");
1061 } 1060 }
1062 1061
1063 if (global.params.useAssert && 1062 if (global.params.useAssert &&
1064 !global.params.useInline) 1063 !global.params.useInline)
1065 { /* Add an assert(0, msg); where the missing return 1064 { /* Add an assert(0, msg); where the missing return