public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: "Weiny, Ira" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] libibmad: Fix conflict with new umad.h header
Date: Fri, 24 Feb 2017 14:55:40 -0700	[thread overview]
Message-ID: <20170224215540.GA29289@obsidianresearch.com> (raw)
In-Reply-To: <2807E5FD2F6FDA4886F6618EAC48510E67C5743A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

On Fri, Feb 24, 2017 at 09:23:26PM +0000, Weiny, Ira wrote:
> 
> Perhaps...
> 
> The question is do you want to rely on BSD or gnu extensions?  My
> reading of the various man pages leads me to the same path as you.
> That the BSD htobe* has become the standard in glibc.

If you go down that rat hole then __BYTE_ORDER__ isn't portable
either..

Which ever you choose, both places should use an identical construct,
introducing two different definitions is evil.

bswap_64 is a tiny bit better because it does not rely on __USE_MISC
which means the public header might compile with -std=c11/-ansi/etc

However I did a little check and some of our public headers already do
not support that mode...

So my conclusion was to go with the simple solution, and mark it
deprecated so we can remove it some day and avoid this worry.

I guess it could get wrappered in '#ifdef htobe64' though - then it
would still support -ansi mode.

> > > +#define ntohll(x) x
> > 
> > missing () around the x.
> 
> Yea missed that...

It is also problematic in that it doesn't force the output to a
consistent 64 bit type, so big/little builds get different types which
is never fun.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2017-02-24 21:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24  5:40 [PATCH] libibmad: Fix conflict with new umad.h header ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1487914827-339-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-02-24 18:24   ` Jason Gunthorpe
     [not found]     ` <20170224182449.GE22491-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-02-24 21:23       ` Weiny, Ira
     [not found]         ` <2807E5FD2F6FDA4886F6618EAC48510E67C5743A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-02-24 21:55           ` Jason Gunthorpe [this message]

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=20170224215540.GA29289@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox