View Issue Details

IDProjectCategoryView StatusLast Update
0000898LDMud 3.6Generalpublic2022-01-09 21:35
Reporterparadox Assigned ToGnomi  
Status resolvedResolutionfixed 
PlatformN/AOSN/AOS VersionN/A
Product Version3.6.4 
Target Version3.6.5Fixed in Version3.6.5 
Summary0000898: Provide line number as an argument to master's log_error lfun hook.
DescriptionPresently, the `log_error` lfun called in master for compiler errors and warnings uses the function signature:

void log_error(string file, string err, int warn)

The "err" argument most typically[0] is a string that includes the file at fault, the error line number, and some context:
sprintf(buff, "%s line %d%s: %s\n", error_file, line, context, what);

I would like to be able to access the line number _without_ having to parse the "err" string. This closer matches the `runtime_error` and `runtime_warning` hooks that receive the line number as one of the arguments to the master `lfun` called by the driver.

Steps To ReproduceCompile an LPC file with warnings or errors, observe that `log_error` in master.c is called, but without providing a line number argument.
TagsNo tags attached.



2021-10-17 22:08

reporter   ~0002660

If you're interested in helping a driver neophyte implement this themselves I'd be willing to try and to submit a PR. If you have any notes on "gotchas" I should watch out for (thinking in particular, for legacy instances not expecting this argument) that would be helpful!


2021-10-22 23:35

reporter   ~0002662

I've put up a "draft" PR here:

I think the main missing piece is test coverage. I will look at that next, advice welcome!

I did some quick manual testing to ensure that this patch still worked on a driver that had a master ob that didn't expect the new argument to its `log_error` function and saw no problems. I also tested that a master ob that _did_ expect the new argument got the right value and it seemed to be working correctly.


2021-10-23 00:16

reporter   ~0002663

> I think the main missing piece is test coverage. I will look at that next, advice welcome!

I made a basic unit test ( that appears to pass locally when I run it. If there's some other test configurations to consider I'm happy to try!


2022-01-08 22:50

reporter   ~0002673

This was resolved by Gnomi merging to master.

Issue History

Date Modified Username Field Change
2021-10-17 21:51 paradox New Issue
2021-10-17 22:08 paradox Note Added: 0002660
2021-10-22 23:35 paradox Note Added: 0002662
2021-10-23 00:16 paradox Note Added: 0002663
2022-01-08 22:50 paradox Note Added: 0002673
2022-01-08 23:02 zesstra Project LDMud 3.5 => LDMud 3.6
2022-01-08 23:02 zesstra Category Other => General
2022-01-08 23:03 zesstra Assigned To => Gnomi
2022-01-08 23:03 zesstra Status new => closed
2022-01-08 23:03 zesstra Resolution open => fixed
2022-01-08 23:03 zesstra Product Version => 3.6.4
2022-01-08 23:03 zesstra Fixed in Version => 3.6.5
2022-01-08 23:03 zesstra Target Version => 3.6.5
2022-01-09 21:35 Gnomi Status closed => resolved