[bug-gsl] Re: #include <*.c> (2007-09-21)
|
From: |
Brian Gough <bjg@gnu.org> |
|
Subject: |
Re: #include <*.c> |
|
Date: |
Fri, 21 Sep 2007 15:14:09 +0100 |
|
To: |
"Naor Jonathan" <jnaor@...........> |
|
Cc: |
bug-gsl@gnu.org |
At Thu, 20 Sep 2007 14:57:49 +0200,
Naor Jonathan wrote:
> I wanted to ask why these are not .h files, and to suggest changing
> the suffix to something other than .c. After I made such a change
> the whole library compiled effortlessly.
Hello,
The convention for this project has been that .h files contain
declarations and macros, while .c files contain actual code.
> Some packages allow the user to supply his/her own memory allocation
> function instead of malloc. Sometimes this is done by giving a
> pointer to such a function. I wanted to suggest replacing every
> malloc in the code with another function, say gsl_malloc, which
> could then be changed by the user. By default this function could
> just be a wrapper for the default malloc.
I have considered this in the past but decided against it. The same
effect can be achieved using the GNU linker --wrap option, and this
allows wrapping of any function not just malloc.
--
best regards,
Brian Gough