All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [meta-networking][PATCH 1/1] yp-tools: fix compile errors
Date: Wed, 17 Aug 2016 16:19:41 -0700	[thread overview]
Message-ID: <69F4079B-660E-417C-827B-8D7458865C6E@gmail.com> (raw)
In-Reply-To: <1471465334-32622-1-git-send-email-jslater@windriver.com>

[-- Attachment #1: Type: text/plain, Size: 4445 bytes --]


> On Aug 17, 2016, at 1:22 PM, Joe Slater <jslater@windriver.com> wrote:
> 
> Fix two fatal warnings.  The cast error only
> occurs for some architectures.
> 
> Signed-off-by: Joe Slater <jslater@windriver.com>
> ---
> .../nis/yp-tools/alignment-cheat.patch             |   58 ++++++++++++++++++++
> .../recipes-support/nis/yp-tools_3.3.bb            |    3 +-
> 2 files changed, 59 insertions(+), 2 deletions(-)
> create mode 100644 meta-networking/recipes-support/nis/yp-tools/alignment-cheat.patch
> 
> diff --git a/meta-networking/recipes-support/nis/yp-tools/alignment-cheat.patch b/meta-networking/recipes-support/nis/yp-tools/alignment-cheat.patch
> new file mode 100644
> index 0000000..856e42e
> --- /dev/null
> +++ b/meta-networking/recipes-support/nis/yp-tools/alignment-cheat.patch
> @@ -0,0 +1,58 @@
> +yp-tools: avoid fatal cast warning
> +
> +The way casting is done, we will get a fatal alignment warning on some
> +architectures.  This patch cheats our way around this.
> +

These changes look fine, however you should run it by the upstream.

> +We also eliminate an unused constant which causes a fatal warning.
> +
> +Upstream-status: Pending
> +
> +Signed-off-by: Joe Slater <jslater@windriver.com>
> +
> +
> +--- a/lib/do_ypcall.c
> ++++ b/lib/do_ypcall.c
> +@@ -44,7 +44,9 @@ struct dom_binding
> + typedef struct dom_binding dom_binding;
> +
> + static const struct timeval RPCTIMEOUT = {25, 0};
> ++#if 0
> + static const struct timeval UDPTIMEOUT = {5, 0};
> ++#endif

perhaps its better to remove the unused code instead of making preprocessor
work even more.

> + static int const MAXTRIES = 2;
> + static pthread_mutex_t ypbindlist_lock = PTHREAD_MUTEX_INITIALIZER;
> + static dom_binding *ypbindlist = NULL;
> +@@ -381,7 +383,7 @@ __ypclnt_call (u_long prog, xdrproc_t xa
> +
> + int
> + do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
> +-	   caddr_t req, xdrproc_t xres, caddr_t resp)
> ++	   caddr_t req, xdrproc_t xres, void *resp)
> + {
> +   dom_binding *ydb;
> +   int status;
> +@@ -450,9 +452,9 @@ do_ypcall (const char *domain, u_long pr
> + /* Like do_ypcall, but translate the status value if necessary.  */
> + int
> + do_ypcall_tr (const char *domain, u_long prog, xdrproc_t xargs,
> +-	      caddr_t req, xdrproc_t xres, caddr_t resp)
> ++	      caddr_t req, xdrproc_t xres, void *resp)
> + {
> +-  int status = do_ypcall (domain, prog, xargs, req, xres, resp);
> ++  int status = do_ypcall (domain, prog, xargs, req, xres, (void *) resp);

resp is already a void pointer why is this typecast needed ?

> +   if (status == YPERR_SUCCESS)
> +     /* We cast to ypresp_val although the pointer could also be of
> +        type ypresp_key_val or ypresp_master or ypresp_order or
> +--- a/lib/internal.h
> ++++ b/lib/internal.h
> +@@ -17,8 +17,8 @@
> + #define _INTERNAL_H_
> +
> + extern int do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
> +-		      caddr_t req, xdrproc_t xres, caddr_t resp);
> ++		      caddr_t req, xdrproc_t xres, void *resp);
> + extern int do_ypcall_tr (const char *domain, u_long prog, xdrproc_t xargs,
> +-			 caddr_t req, xdrproc_t xres, caddr_t resp);
> ++			 caddr_t req, xdrproc_t xres, void *resp);
> + extern int yp_maplist (const char *, struct ypmaplist **);
> + #endif
> diff --git a/meta-networking/recipes-support/nis/yp-tools_3.3.bb b/meta-networking/recipes-support/nis/yp-tools_3.3.bb
> index b89f0b8..69217fa 100644
> --- a/meta-networking/recipes-support/nis/yp-tools_3.3.bb
> +++ b/meta-networking/recipes-support/nis/yp-tools_3.3.bb
> @@ -11,11 +11,10 @@ ypwhich, yppasswd, domainname, nisdomainname \
> and ypdomainname. \
> "
> 
> -PNBLACKLIST[yp-tools] ?= "BROKEN: fails to build for qemuarm."
> -
> SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \
>            file://domainname.service \
>            file://yp-tools-ipv4-ipv6-Provide-an-in-place-version-of-mapv4v6addr.patch \
> +           file://alignment-cheat.patch \
> "
> SRC_URI[md5sum] = "acebeecc11a73fb8097503670344834c"
> SRC_URI[sha256sum] = "812be817df3d4c25813552be336c6c6ad5aedaf65611b81af3ad9f98fb3c2e50"
> --
> 1.7.9.5
> 
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

  reply	other threads:[~2016-08-17 23:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 20:22 [meta-networking][PATCH 1/1] yp-tools: fix compile errors Joe Slater
2016-08-17 23:19 ` Khem Raj [this message]
2016-08-18 16:52   ` Slater, Joseph
2016-08-18 17:47     ` Khem Raj
2016-08-18 18:20     ` Joe MacDonald

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=69F4079B-660E-417C-827B-8D7458865C6E@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.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.