View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000895 | LDMud 3.5 | LPC Compiler/Preprocessor | public | 2021-09-30 21:49 | 2021-09-30 22:19 |
| Reporter | paradox | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Summary | 0000895: Pragma to detect unused variables/functions | ||||
| Description | I'm not sure how feasible this is to implement but it would be great if there was an opt-in #pragma directive that could be used to tell the LPC compiler/preprocessor you'd like unused variables or functions to be considered an error (or even a warning!). Thanks for all the work on LDMud :-) | ||||
| Steps To Reproduce | Compile a program that has variables or functions that are not used. Observe there is no warning/indication of a problem. | ||||
| Tags | No tags attached. | ||||
|
|
LDMud 3.6.3 introduced the pragma warn_unused_variables which does this for unused variables. Unused functions are difficult, because they could be used by call_other or inheritance. Only in case of private functions, a warning would be possible. I am not sure, that limited use case warrants the effort. |
|
|
> LDMud 3.6.3 introduced the pragma warn_unused_variables which does this for unused variables. Oh! Thank you. I had missed that. > Unused functions are difficult, because they could be used by call_other or inheritance. Only in case of private functions, a warning would be possible. I am not sure, that limited use case warrants the effort. This makes sense to me. Honestly I was most interested in unused variables. Thanks Zesstra! |
|
|
Detecting unused functions for LPC is tricky due to runtime call_other/inheritance. Detecting unused variables is already supported in 3.6.3+ with pragma warn_unused_variables. I missed this because I checked 'man pragma' on 3.5.4. I think we can close this out. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-09-30 21:49 | paradox | New Issue | |
| 2021-09-30 22:12 | zesstra | Note Added: 0002657 | |
| 2021-09-30 22:16 | paradox | Note Added: 0002658 | |
| 2021-09-30 22:19 | paradox | Status | new => closed |
| 2021-09-30 22:19 | paradox | Resolution | open => fixed |
| 2021-09-30 22:19 | paradox | Note Added: 0002659 |