View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000430 | LDMud 3.3 | Runtime | public | 2006-01-01 03:27 | 2018-01-29 21:57 |
Reporter | fufu | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.3.712 | ||||
Fixed in Version | 3.3.713 | ||||
Summary | 0000430: the driver generates too many runtime missing 'return <value>' warnings | ||||
Description | In some cases, functions will be compiled with a runtime check for 'falling off' the body; this will cause a warning to be printed every time that happens. As this can happen several thousand times in a single evaluation this has the potential to fill up log files very fast. | ||||
Additional Information | Technically, this is implemented with the F_DEFAULT_RETURN opcode. When it's executed, it prints a warning and then falls through to the F_RETURN0 code. I'll attach a patch that replaces the F_DEFAULT_RETURN with an F_RETURN0 after the warning has been printed, reducing the number of warnings tremendously. As far as I can see, the instruction is only generated by prolang.y and patching it should be safe. I've tested the patch and it works for me. | ||||
Tags | No tags attached. | ||||
Attached Files | warn-missing-return-once.diff (476 bytes)
Index: src/interpret.c =================================================================== --- src/interpret.c (revision 2253) +++ src/interpret.c (working copy) @@ -8450,6 +8450,8 @@ * corrected. */ warnf("Missing 'return <value>' statement.\n"); + /* Warn only once per missing return and program. */ + PUT_UINT8(pc-1, F_RETURN0); /* FALLTHROUGH */ CASE(F_RETURN0); /* --- return0 --- */ | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2006-01-01 03:27 | fufu | New Issue | |
2006-01-01 03:27 | fufu | File Added: warn-missing-return-once.diff | |
2006-03-01 13:01 |
|
Status | new => resolved |
2006-03-01 13:01 |
|
Fixed in Version | => 3.3.713 |
2006-03-01 13:01 |
|
Resolution | open => fixed |
2006-03-01 13:01 |
|
Assigned To | => lars |
2006-03-01 13:01 |
|
Note Added: 0000481 | |
2007-10-06 19:55 |
|
Status | resolved => closed |
2010-11-16 09:42 |
|
Source_changeset_attached | => ldmud.git master 1977ba92 |
2018-01-29 18:59 |
|
Source_changeset_attached | => ldmud.git master 1977ba92 |
2018-01-29 21:57 |
|
Source_changeset_attached | => ldmud.git master 1977ba92 |