File and line numbers in error messages

Ken Raeburn raeburn at MIT.EDU
Tue Apr 28 18:55:37 EDT 2009


On Apr 28, 2009, at 18:42, Russ Allbery wrote:
> You can do it without requiring either C99 or GCC if you're willing to
> fall back to using an inline function and provide a version of
> krb5_set_error_message that takes a va_list instead of variable
> arguments.  But that might be overkill.  (I do that as a standard part
> of the error handling library for most of the code I write, if you  
> want
> to look at a working and tested implementation.)

If you use __LINE__ in an inline function, you're going to get the  
line number of the inline function.  So how would you get the correct  
line numbers added in each call, without changing every call site?

-- 
Ken Raeburn / raeburn at mit.edu / no longer at MIT Kerberos Consortium




More information about the krbdev mailing list