Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp551107ybb; Thu, 28 Mar 2019 07:39:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4bwIyWWKqsK8Kr4EHnnYDOYkB2vN+PPcj7EBcwnduGJ7i0qmhedKqfujC/ypjOHFIjkK8 X-Received: by 2002:a63:1203:: with SMTP id h3mr7280801pgl.164.1553783989099; Thu, 28 Mar 2019 07:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553783989; cv=none; d=google.com; s=arc-20160816; b=StkGtM9uFeA9ZtxYg0Kh2f2sFijzB774NSxYMKTZCDR6OPBtuPSYLpidnlZWk/+GcL rib7Ne6zjY2YaEd5aCVfmymm+aPdtSqplTWpm4iz9MV9tdH2iwalEwmaMY3LS47zjtrC BNi30Hj2qXjk7InFGdw5FXOfmZxChs4XzaBLRteGTw1VdVOO6teKAW1mAvfii6s+AtPs hahscFsKkFGpP5zWxfq6E0KIa0FXi0tn8+oHwMk48sMOOeMbZ1/80f5DgkL6GG/7BC3R 35S3YX49AWiXo+mdBPULJitxowTGVYv/pu3mXqk6ZCk2+Wn2G0F9l6jeOBxyqLSV0ipQ 3SpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AQ3+TH2TAd+zg8omRE3N+qEiuvxMp+BLut05jNg0Ce0=; b=WO85c0pVHc/Z9K5TljHo3Gtqzd+/cdFPuOgXX2dt8Dv6cgIdbNUPpa86f1u8MM2CsB F0CHIc6T97TaSxwLU1fLuUsE+dnCsJKdzf847UVz0oISJyiUEkSU637RIN9eDItUuIpZ qAPqjNQ0sAdh/dq+RplKQjSQdDPWuAEgakfucndaws2UXRizYoudSHukrfP4U2yzjXHL +V3Ua8HmRslq1lDjhlpYMx1s9C9C1VQGPyRtDiZyDih/7ZBuD/f8RraKLmaAgm3QVASP 3S6DP+D31vWLPoAZYUImH+YQcTIMBO0dTtUPHqfkdHroNrVdZuaeuXpHYi6zHlOjix2B zkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kYQ6AMnc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si15549559pgh.356.2019.03.28.07.39.32; Thu, 28 Mar 2019 07:39:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kYQ6AMnc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbfC1Oi2 (ORCPT + 99 others); Thu, 28 Mar 2019 10:38:28 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:42877 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbfC1Oi1 (ORCPT ); Thu, 28 Mar 2019 10:38:27 -0400 Received: by mail-yw1-f66.google.com with SMTP id e76so15166452ywa.9; Thu, 28 Mar 2019 07:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AQ3+TH2TAd+zg8omRE3N+qEiuvxMp+BLut05jNg0Ce0=; b=kYQ6AMncm5AUD03kZYPPZjDusKLAmg1+H/PVurk4Sfs0h99KITrwZNbZ1ADbK6IAtn /rBN+WK9jdMPIUKD8lZdCaah7qdqMBUj2Gcf3VSaNlfET34HsKyYhOMwfy29/+T8m4fe 3YkFPJBW9O4iKjGcNC5baMWYwYmEcW6CXTH/Nq/qHdcg7E77nCRbMioWj7XvKl+j30Qw MVOkrIfbMgIlCqgYcikN0GC7On/bNVU2soINGXx8mcoDMK5rHbop7uJhsyyWrTwqfmuw IYwptkNvsEbp8Fpk2y5UFrRBzuyh0UfN5B+rjSKdE1LBlKr43cNma6iNeRkrM6PllzuA FKDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AQ3+TH2TAd+zg8omRE3N+qEiuvxMp+BLut05jNg0Ce0=; b=U01YlZEp6CNot9OysQf/TmPk/sudiFdIIYJo+KfX0aBmBrJ/ZMIzqjdIlsx1sPifgq MOAGTKBi2b/JUqADpOj6KlQk1m7vCiEfqvuS09VIP8D/Nk+2k/KRvRr+MKqK0kN2jVhQ Y9H27gUPtYChhYoXzGHV9kGpK75Puyc30sQG/sszFM1ltdErFRSlnt2LbNNiGvIf0x/x BLn2dmnTE0Vshjs3hue/dPwJQlFK5VQwBAt4mtw1f6nzTw6iPZQQKP72BVX6SsvZvZ1/ Yfn5BeMP7fqpPXDBi5sHpKFglbMr1dNYYyKnroSJP2A4re5pFyhiyu3tivh688eJ8+pT q5gg== X-Gm-Message-State: APjAAAWRFhBz5+DL/aOpG7GLT17Td9Ew5iyN69+Y2tjwyvc17sFVd/nQ P+6F/rXUNaNfizl9oI3t2hFMl62AqBUVqaWKPkM= X-Received: by 2002:a81:6d51:: with SMTP id i78mr36749518ywc.273.1553783906755; Thu, 28 Mar 2019 07:38:26 -0700 (PDT) MIME-Version: 1.0 References: <20190328141652.wssqboyekxmp6tkw@yubo-2> In-Reply-To: From: Bo YU Date: Thu, 28 Mar 2019 22:38:15 +0800 Message-ID: Subject: =?UTF-8?Q?Re=3A_=5BPATCH=5D_bpf=3A_bpftool=3A_convert_=E2=80=98const_char_=2A=E2=80=99?= =?UTF-8?Q?_type_into_=27char_=2A=27_in_assignment?= To: Quentin Monnet Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , songliubraving@fb.com, Yonghong Song , jakub.kicinski@netronome.com, df@google.com, Netdev , bpf@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 28, 2019 at 10:33 PM Quentin Monnet wrote: > > 2019-03-28 10:16 UTC-0400 ~ Bo YU > > When compiling with check flag: make -C tools/bpf/bpftool/ > > gcc will warning: > > > > jit_disasm.c:119:29: warning: assignment discards =E2=80=98const=E2=80= =99 qualifier from > > pointer target type [-Wdiscarded-qualifiers] > > info.disassembler_options =3D disassembler_options; > > > > So convert 'const char *' type into 'char *' to fix the warning. > > > > Fixes:3ddeac6705aba(tools: bpftool: use 4 context mode for the NFP disa= sm) > > Signed-off-by: Bo YU > > --- > > tools/bpf/bpftool/jit_disasm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/bpf/bpftool/jit_disasm.c > > b/tools/bpf/bpftool/jit_disasm.c > > index 3ef3093560ba..40b46e46454a 100644 > > --- a/tools/bpf/bpftool/jit_disasm.c > > +++ b/tools/bpf/bpftool/jit_disasm.c > > @@ -116,7 +116,7 @@ void disasm_print_insn(unsigned char *image, ssize_= t > > len, int opcodes, > > info.arch =3D bfd_get_arch(bfdf); > > info.mach =3D bfd_get_mach(bfdf); > > if (disassembler_options) > > - info.disassembler_options =3D disassembler_options; > > + info.disassembler_options =3D (char *)disassembler_options; > > info.buffer =3D image; > > info.buffer_length =3D len; > > > > > Hi, the warning does not show with latest versions of binutils, it was > fixed with this (binutils) commit: > > commit f995bbe8e62fdb5607acb1ee127240cfe50d2b8f > Author: Pedro Alves > Date: Wed Apr 5 19:21:33 2017 +0100 > > -Wwrite-strings: Constify struct disassemble_info's > disassembler_options field > > Distributions with recent binutils (Ubuntu 18.04, Fedora 29 at least) > should not have this message. I thought about sending the same patch > some time ago, but in the end Jakub and I decided that it may not be > worth casting the const away to silence the warning just for older > distributions. Daniel also shared the same opinion at the time (but that > was off the mailing-list). Ok, good to know it. Thanks, > > Quentin