This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Help-gsl] GSL and C99 standard


On Tue, Apr 15, 2008 at 11:37:10AM +0100, Brian Gough wrote:
> At Fri, 11 Apr 2008 15:40:25 +0300,
> Heikki Orsila wrote:
> > Are there many users that can not support any C99 features?
> 
> One area I know of: it is a problem for embedded systems, when
> compilers aren't updated by the manufacturer.  That's something I want
> to support.

How many embedded systems really lack this? Existing users may use old 
versions of the library if C99 is allowed. Afaik, most embedded systems 
support GNU compilers thesedays. And, we're not argeting 8/16 bit 
systems with GSL ;)

> > I think the the relevant question is which C99 features, not the whole 
> > feature set. For example, I would like to use named initializers for 
> > structures as they make code more maintainable and easier to read:
> > gcc has supported this feature for ages already..
> 
> For code internal to the library I think we would stick with C89
> compatible syntax.  
> 
> It makes sense to use C99 functions internally where it's possible to
> do that without breaking C89 compatibility, by providing portable
> versions as a fallback.  We've done some of that with functions like
> isfinite(), but there are other cases that could be changed.

Writing both C89 and C99 implementations doubles the number of bugs. So 
it's definitely not wise to use C99 if a C89 implementation exists.

> It is mainly a question of how C99 could benefit users.  The main
> areas would be
> 
>  - native complex numbers
>  - restricted pointers for optimisation
>  - new IEEE floating point functions/exception handling

The benefit of C99 is common conventions that are portable between 
projects. The new floating point stuff is probably useful for GSL, but I 
see C99 being much more than that. It makes general coding easier.

-- 
Heikki Orsila
heikki.orsila@iki.fi
http://www.iki.fi/shd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]