From: Rafael Kitover Date: Fri, 15 Oct 2021 04:40:03 +0000 (+0000) Subject: Improve trace(). X-Git-Tag: v4.0.1rc1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20c328bdcc0311555b87c72d770e7b4cbdb53871;p=procps-ng Improve trace(). Turn on trace() with the TRACE macro and remove the ## token paste preprocessor operator which is unnecessary here and causes these errors: ps/common.h:176:26: error: pasting "(" and ""ps_argv[thisarg] is %s\n"" does no t give a valid preprocessing token . Send trace output to STDERR. Tracing can be enabled by adding TRACE to CPPFLAGS as follows: ./configure CPPFLAGS="-DTRACE" Signed-off-by: Rafael Kitover --- diff --git a/src/ps/common.h b/src/ps/common.h index ee08cdc9..26bd38c0 100644 --- a/src/ps/common.h +++ b/src/ps/common.h @@ -181,8 +181,8 @@ makEXT(noop) // --- interface end |||||||||||||||||||||||||||||||||||||||||||||| -#if 0 -#define trace(...) printf(## __VA_ARGS__) +#if TRACE +#define trace(...) fprintf(stderr, __VA_ARGS__) #else #define trace(...) #endif