View Issue Details

IDProjectCategoryView StatusLast Update
0000811LDMud 3.3LPC Compiler/Preprocessorpublic2012-12-12 20:16
Reportersinnvoll Assigned Tofufu  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.3.720 
Target Version3.3.721Fixed in Version3.3.721 
Summary0000811: predefined define __FUNCTION__ for the name of the function
Description__FUNCTION__ could be replaced with the name of the current function.

example:

int set_value(int i)
{
   v=i;
   if(i) do_error(" Error in Function "+__FUNCTION__+" ");
}

output of set_value(1); :
 Error in Function set_value
TagsNo tags attached.

Activities

zesstra

2012-09-18 22:25

administrator   ~0002150

Last edited: 2012-09-18 22:27

Just in case you don't know the possibility: you can already get the current lfun name with debug_info(). Or you just use debug_info() to dump some more info in addition to the name.
You might argue that is consumes more ressources than necessary, but then errors should be the exception, I guess.

Depending on the error it might also be a good idea to dump/store the whole stacktrace to be able to trace the source of error. At least I made the experience, that the plain info "error in function xy" usually does not help me too much.

fufu

2012-09-29 01:38

manager   ~0002151

I agree with Zesstra that a __FUNCTION__ predefine is of limited use. But it's not hard to implement if we want it:

https://github.com/Fuchur/ldmud/commit/07c3c3c35e6c6bf6fc11fd085f0b65b1f00c53f8

zesstra

2012-09-29 16:19

administrator   ~0002152

Yay, somebody submitted a patch. :-)
I don't have anything against it, so from my side feel free to apply it to the trunk.

(ok, now we only need to finally migrate our main repository to github...)

zesstra

2012-12-08 23:09

administrator   ~0002172

Fuchur,

do you want to take care of committing this? If not, re-assign to me.
I have a comment after all: I am not sure, if the name in inline closures should not be the auto-generated name for the inline, because technically it is another function...?

BTW: We moved the primary source repository now to github.com, so please either push your changes to https://github.com/ldmud/ldmud or file a pull request against it. :-)

fufu

2012-12-12 16:24

manager   ~0002178

I'll push it later tonight.

fufu

2012-12-12 20:15

manager   ~0002179

pushed as 6e0b4b85543c3af3ab5c7d30db2f3b12a9260466 (3.3 branch) and dae6067cf15017605b04ff85b77b0fd856e1756a (master branch)

Issue History

Date Modified Username Field Change
2012-09-18 10:58 sinnvoll New Issue
2012-09-18 22:25 zesstra Note Added: 0002150
2012-09-18 22:27 zesstra Note Edited: 0002150
2012-09-29 01:38 fufu Note Added: 0002151
2012-09-29 16:19 zesstra Note Added: 0002152
2012-12-08 23:09 zesstra Note Added: 0002172
2012-12-08 23:09 zesstra Assigned To => fufu
2012-12-08 23:09 zesstra Status new => assigned
2012-12-08 23:18 zesstra Project LDMud => LDMud 3.3
2012-12-08 23:20 zesstra Product Version => 3.3.720
2012-12-08 23:20 zesstra Target Version => 3.3.721
2012-12-12 16:24 fufu Note Added: 0002178
2012-12-12 20:15 fufu Note Added: 0002179
2012-12-12 20:16 fufu Status assigned => resolved
2012-12-12 20:16 fufu Fixed in Version => 3.3.721
2012-12-12 20:16 fufu Resolution open => fixed