All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: <xen-devel@lists.xenproject.org>,
	Ian Jackson <iwj@xenproject.org>, "Wei Liu" <wl@xen.org>
Subject: Re: [SUSPECTED SPAM][RESEND PATCH 1/2] tools/libxl: Mark pointer args of many functions constant
Date: Wed, 28 Apr 2021 18:12:29 +0100	[thread overview]
Message-ID: <YImXfc4oaPgWzkeT@perard> (raw)
In-Reply-To: <2e18b114fc91028459b2d6cbfd0f1204501dfde9.1613496229.git.ehem+xen@m5p.com>

On Fri, Dec 18, 2020 at 01:37:44PM -0800, Elliott Mitchell wrote:
> --- a/tools/libs/light/libxl_internal.h
> +++ b/tools/libs/light/libxl_internal.h
> @@ -2073,9 +2073,9 @@ struct libxl__xen_console_reader {
>  /* parse the string @s as a sequence of 6 colon separated bytes in to @mac */
>  _hidden int libxl__parse_mac(const char *s, libxl_mac mac);
>  /* compare mac address @a and @b. 0 if the same, -ve if a<b and +ve if a>b */
> -_hidden int libxl__compare_macs(libxl_mac *a, libxl_mac *b);
> +_hidden int libxl__compare_macs(const libxl_mac *a, const libxl_mac *b);
>  /* return true if mac address is all zero (the default value) */
> -_hidden int libxl__mac_is_default(libxl_mac *mac);
> +_hidden int libxl__mac_is_default(const libxl_mac *mac);

It turns out that older version of gcc complains about the const of
libxl_mac:


    libxl_nic.c: In function 'libxl_mac_to_device_nic':
    libxl_nic.c:40:9: error: passing argument 1 of 'libxl__compare_macs' from incompatible pointer type [-Werror]
             if (!libxl__compare_macs(&mac_n, &nics[i].mac)) {
             ^
    In file included from libxl_nic.c:18:0:
    libxl_internal.h:2076:13: note: expected 'const uint8_t (*)[6]' but argument is of type 'uint8_t (*)[6]'
     _hidden int libxl__compare_macs(const libxl_mac *a, const libxl_mac *b);
                 ^
    libxl_nic.c:40:9: error: passing argument 2 of 'libxl__compare_macs' from incompatible pointer type [-Werror]
             if (!libxl__compare_macs(&mac_n, &nics[i].mac)) {
             ^
    In file included from libxl_nic.c:18:0:
    libxl_internal.h:2076:13: note: expected 'const uint8_t (*)[6]' but argument is of type 'uint8_t (*)[6]'
     _hidden int libxl__compare_macs(const libxl_mac *a, const libxl_mac *b);
                 ^
    libxl_nic.c: In function 'libxl__device_nic_setdefault':
    libxl_nic.c:69:5: error: passing argument 1 of 'libxl__mac_is_default' from incompatible pointer type [-Werror]
         if (libxl__mac_is_default(&nic->mac)) {
         ^
    In file included from libxl_nic.c:18:0:
    libxl_internal.h:2078:13: note: expected 'const uint8_t (*)[6]' but argument is of type 'uint8_t (*)[6]'
     _hidden int libxl__mac_is_default(const libxl_mac *mac);
                 ^
    cc1: all warnings being treated as errors


That happens on ubuntu trusty, debian jessie, and centos 7.

Cheers,

-- 
Anthony PERARD


  parent reply	other threads:[~2021-04-28 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 17:23 [RESEND PATCH 0/2] Adding const to many libxl/xl functions Elliott Mitchell
2020-12-18 21:32 ` [RESEND PATCH 2/2] tools/xl: Mark libxl_domain_config * arg of printf_info_*() const Elliott Mitchell
2021-04-27 14:54   ` Anthony PERARD
2020-12-18 21:37 ` [RESEND PATCH 1/2] tools/libxl: Mark pointer args of many functions constant Elliott Mitchell
2021-04-27 14:53   ` Anthony PERARD
2021-04-28 17:12   ` Anthony PERARD [this message]
2021-04-28 17:29     ` [SUSPECTED SPAM][RESEND " Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YImXfc4oaPgWzkeT@perard \
    --to=anthony.perard@citrix.com \
    --cc=ehem+xen@m5p.com \
    --cc=iwj@xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.