public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: libelf gelf_newehdr and gelf_newphdr return types
Date: Wed, 07 Dec 2016 00:09:14 +0100	[thread overview]
Message-ID: <20161206230914.GD15811@stream> (raw)
In-Reply-To: 24bd1ec2-efa2-e900-80cf-52dd27e1cd77@Oracle.COM

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

On Tue, Dec 06, 2016 at 09:45:31AM -0700, Ali Bahrami wrote:
> > Which is slightly horrible. But neither the Solaris documentation, nor
> > the elfutils libelf documentation seem to actually make any promise
> > about the return value. It is only implied that, like all gelf
> > functions, zero will be returned on failure.
> > 
> > I wanted to update the elfutils gelf documentation for these functions
> > to state that the returned pointer is to the appropriate header for the
> > ELF class. Which I believe is the only sane thing to do. I don't know of
> > any libelf implementation where the comment from dwz is true.
> 
>    I'm not aware of libelf implementations where the return
> value isn't the pointer to the underlying class specific
> header, but I suppose that there could be one.
> 
> I never thought I'd argue against clarifying documentation,
> but I'm not sure that making this any more explicit is really
> helping anyone. It really doesn't make sense that a library
> that exists to provide class independent access to objects
> returns a class dependent pointer, and I think the intent
> really is that callers only pay attention to 0 vs non-zero.
> Perhaps the documentation should just say that, while the
> internals return the pointer as they always have, to maintain
> compatibility with the past.

Grin. I am not sure that will deter people from assuming
what it really points to. But OK, I'll only document that
NULL means failure.

Cheers,

Mark

             reply	other threads:[~2016-12-06 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 23:09 Mark Wielaard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-06 23:41 Ali Bahrami
2016-12-06 16:45 Ali Bahrami
2016-12-06 14:31 Mark Wielaard
2016-12-06 13:47 Mark Wielaard
2016-12-03 22:02 Kurt Roeckx
2016-12-03 21:05 Ali Bahrami
2016-12-02 20:39 Ali Bahrami
2016-12-02 20:25 Ali Bahrami
2016-12-02 19:00 Josh Stone
2016-12-02  9:42 Mark Wielaard

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=20161206230914.GD15811@stream \
    --to=mark@klomp.org \
    --cc=elfutils-devel@lists.fedorahosted.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).