From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2-next] ip: Use single variable to represent -pretty Date: Thu, 15 Feb 2018 10:58:15 -0800 Message-ID: <20180215105815.1fe9fed3@xeon-e3> References: <1518719493-29333-1-git-send-email-serhe.popovych@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Serhey Popovych Return-path: Received: from mail-pg0-f46.google.com ([74.125.83.46]:36838 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161962AbeBOS6S (ORCPT ); Thu, 15 Feb 2018 13:58:18 -0500 Received: by mail-pg0-f46.google.com with SMTP id j9so492292pgv.3 for ; Thu, 15 Feb 2018 10:58:18 -0800 (PST) In-Reply-To: <1518719493-29333-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 15 Feb 2018 20:31:33 +0200 Serhey Popovych wrote: > After commit a233caa0aaee ("json: make pretty printing optional") I get > following build failure: > > LINK rtmon > ../lib/libutil.a(json_print.o): In function `new_json_obj': > json_print.c:(.text+0x35): undefined reference to `show_pretty' > collect2: error: ld returned 1 exit status > make[1]: *** [rtmon] Error 1 > make: *** [all] Error 2 > > It is caused by missing show_pretty variable in rtmon. > > On the other hand tc/tc.c there are two distinct variables and single > matches() call that handles -pretty option thus setting show_pretty > will never happen. Note that since commit 44dcfe820185 ("Change > formatting of u32 back to default") show_pretty is used in tc/f_u32.c > so this is first place where -pretty introduced. > > Furthermore other utilities like misc/ifstat.c and misc/nstat.c define > pretty variable, however only for their own purposes. They both support > JSON output and thus depend show_pretty in new_json_obj(). > > Assuming above use common variable to represent -pretty option, define > it in utils.c and declare in utils.h that is commonly used. Replace > show_pretty with pretty. > > Fixes: a233caa0aaee ("json: make pretty printing optional") > Signed-off-by: Serhey Popovych > --- Looks Good to me. Not sure it did not show up in my builds. I am fixing bridge to use similar json/color/pretty flags.