public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Brian Gough <bjg@gnu.org>
To: Gerard Jungman <jungman@lanl.gov>
Cc: gsl-discuss@sourceware.org
Subject: Re: some general questions
Date: Wed, 14 Oct 2009 20:00:00 -0000	[thread overview]
Message-ID: <m3r5t5g34s.wl%bjg@network-theory.co.uk> (raw)
In-Reply-To: <1254861292.28192.239.camel@manticore.lanl.gov>

[Sorry for the delay in replying, I was moving house.]

At Tue, 06 Oct 2009 14:34:52 -0600,
Gerard Jungman wrote:
> Let me see if I understand this. There are two independent
> definitions of the GSL_RANGE_COND macro, one which knows
> about gsl_check_range, and one which doesn't. GSL header
> files with inline function definitions use the version
> which does not know about gsl_check_range, through its
> definition in gsl_inline.h. C implementation files use
> the one which does know about gsl_check_range, through
> its definition in build.h. Is this right?

Yes, that is correct.

> It's confusing to me, but never mind that. What I don't
> understand is how you prevent them from colliding in the
> presence of both definitions. Obviously I understand
> that build.h #undef's it and redefines it. I'm not
> asking a mechanical question. I mean to ask, why
> do they need to be the same name?

We now compile all the non-inline versions of functions directly from
their inline definitions in the header files.  This avoids any
inconsistencies (previously we had separate implementations).
GSL_RANGE_COND is redefined in the non-inline version to allow range
checking via gsl_check_range so the user can at least manually make it
consistent with their choice of whether or not to use range checking
in the inline versions.

> This is the part I am asking about. I remember when that happened,
> and somebody reported it. This was years ago. And I thought we
> concluded that such compilers were brain-damaged, but we would
> just go ahead and placate them. Q: Are such compilers still
> brain-damaged, are they actually doing the right thing (I can't
> imagine), or what?

I don't have my copy of the standard at the moment.  Maybe somebody
could look it up.

> I think this has bugged me other times as well, though I
> couldn't put my finger on what was wrong. I just kept
> making clean and rebuilding. Well, does it work better
> now? If so, then let's turn it on.

Ok, I have just done that.

> It's not obvious that they would be unreadable. What I'm asking
> is, can you think of some clever way to make them both readable
> and generic?

Not really.  Suppose someone knows (partially) the name of the
function or some other part of the prototype and greps the header
files for it -- if it is declared via a macro they will not find it.

> > A starting point would be to generate a dependency graph using one of
> > the automated tools for this - for example, GNU cflow.
> 
> I don't think this is a problem for machine solution. It's up to
> us to decide how the thing is organized. What depends on what,
> which parts are foundational, and which parts are built on
> top of those? Then we should organize the code so it
> expresses that.

I was just thinking that it's not always obvious what the dependencies
are. For example, the special functions depend on linear algebra
(through the Mathieu function, which needs to compute some
eigenvalues) and there may be some other cases like that.



  parent reply	other threads:[~2009-10-14 20:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 10:12 containers tentative design summary Gerard Jungman
2009-10-05 14:50 ` James Bergstra
2009-10-05 23:00   ` Gerard Jungman
2009-10-05 23:45     ` James Bergstra
2009-10-06 19:59       ` Gerard Jungman
     [not found]     ` <645d17210910060537s762d6323pfd2bec8590ad28e9@mail.gmail.com>
2009-10-06 20:02       ` Gerard Jungman
2009-10-23 21:28     ` Brian Gough
2009-10-27 23:06       ` Gerard Jungman
     [not found]         ` <7f1eaee30910271628h70785125m68e47c7a7b5c25b7@mail.gmail.com>
2009-10-27 23:49           ` Gerard Jungman
2009-10-29 18:06         ` Brian Gough
2009-10-29 20:41           ` Gerard Jungman
2009-10-29 21:40             ` James Bergstra
2009-10-30 16:54               ` Brian Gough
2009-10-30 16:54             ` Brian Gough
2009-10-05 23:04   ` some general questions Gerard Jungman
2009-10-06 16:21     ` Brian Gough
2009-10-06 20:32       ` Gerard Jungman
2009-10-10 14:45         ` Tuomo Keskitalo
2009-10-24 11:16           ` Brian Gough
2009-10-14 20:00         ` Brian Gough [this message]
2009-10-15 18:39           ` Tuomo Keskitalo

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=m3r5t5g34s.wl%bjg@network-theory.co.uk \
    --to=bjg@gnu.org \
    --cc=gsl-discuss@sourceware.org \
    --cc=jungman@lanl.gov \
    /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).