Re: [PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-02 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes:

 +#else
 +
 +/*
 + * Macros to add file:line - see above for C-style declarations of how these
 + * should be used.
 + *
 + * TRACE_CONTEXT may be set to __FUNCTION__ if the compiler supports it. The
 + * default is __FILE__, as it is consistent with assert(), and static 
 function
 + * names are not necessarily unique.
 + */
 +#define TRACE_CONTEXT __FILE__

Hmph, seeing may be set to forces me to wonder how.  Perhaps #ifndef/#endif
around it?

Also, can it be set to something like __FILE__ : __FUNCTION__
which may alleviate the alleged problem of not necessarily unique
perhaps?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-02 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes:

 Also, can it be set to something like __FILE__ : __FUNCTION__
 which may alleviate the alleged problem of not necessarily unique
 perhaps?

 Should work with MSVC. With GCC, however, __FUNCTION__ is a string constant
 supplied by the compiler, so string literal concatenation doesn't work.

Shucks, but not too big a deal, I guess ;-)

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-02 Thread Karsten Blees
Am 02.07.2014 20:57, schrieb Junio C Hamano:
 Karsten Blees karsten.bl...@gmail.com writes:
 
 +#else
 +
 +/*
 + * Macros to add file:line - see above for C-style declarations of how these
 + * should be used.
 + *
 + * TRACE_CONTEXT may be set to __FUNCTION__ if the compiler supports it. The
 + * default is __FILE__, as it is consistent with assert(), and static 
 function
 + * names are not necessarily unique.
 + */
 +#define TRACE_CONTEXT __FILE__
 
 Hmph, seeing may be set to forces me to wonder how.  Perhaps #ifndef/#endif
 around it?
 

Right, shame on me. I didn't think it would be important enough to warrant a
Makefile option, but #ifndef sure wouldn't hurt.

 Also, can it be set to something like __FILE__ : __FUNCTION__
 which may alleviate the alleged problem of not necessarily unique
 perhaps?
 

Should work with MSVC. With GCC, however, __FUNCTION__ is a string constant
supplied by the compiler, so string literal concatenation doesn't work.

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html