I agree that better error checks are good, but the design goal of the #pike construct is to be able to keep running code that is de facto running on older pike versions.
Granted, the old code is not bug free, and it will probably misbehave in some corner cases. But the fact remains that the code is working good enough in practice, and so it shouldn't loudly stop working when a new pike is used in compat mode.
All the test cases I've committed so far are condensed from code like that. For example, here's a real case:
mapping find_file(string file, object id) { string cache_id; string result; int menunum; string menutype; string imagetype; if(sscanf(file,"%s/%s/%s/_.%s", cache_id,menunum,menutype,imagetype)<4) return 0;
object f=Stdio.File();
if(!f->open(get_cache_dir()+"/"+cache_id+"/"+menutype+menunum+"."+imagetype,"r")) { return 0; } return http_file_answer(f,"image/"+imagetype); }
menunum has the wrong type here. During runtime a string will be stored there. That usually works just fine in this function. The only problem might be that it doesn't fail correctly in case the input string is incorrectly formatted and doesn't contain a formatted integer after the first "/" (that's assuming that the type is correct and the sscanf format is wrong; it could be the other way around too).
This code is flawed, but it has been working good enough. In compat mode it should continue to do so. The errors may still be reported as warnings, though.