On 8 Jun., 14:21, Sergey Bochkanov <[email protected]>
wrote:
> Hello, SAGE developers!
>
> I have a question about C standard which SAGE packages should conform
> to. Is it C99? Plain ANSI C? "Modern ANSI C", i.e. ANSI C which
> borrowed several features from C99?
I think you should *either* use ANSI C89, ISO C90 (almost identical)
*or* ISO C99 (but not non-standardized mixtures).
It should be pretty ok to use ISO C99 ("-std=c99") because parts of
the Sage library already require it.
(Note that gcc nevertheless adds some GNU features if this is
specified, but that doesn't mean you should use them.)
> I am working on Python<=>ALGLIB interface with intention to make it
> usable from SAGE. It is Python interface to the pure C package,
> created using CTYPES. I.e. C part of this interface is not C extension
> to Python package, it is totally separate shared library which is used
> through CTYPES foreign function library.
>
> Python-C interface generator is ready, now I work in automatic
> generation of C code. One week, I think, and it will be ready. But I
> can't decide what C standard to choose.
>
> As for me, I'd like to use ANSI C with several widely supported
> features from C99 - inline functions, "//" comments, maybe something
> else. But this thing should be compiled for SAGE, so I don't know can
> I use something beyond ANSI C or not.
See above. I'd strongly discourage the use of "some" new features in
conjunction with an otherwise old standard (though there are currently
parts in Sage that violate this - IMHO to be fixed).
> There is no information on this subject at the SAGE Developer Guide,
> so I am asking this question here.
Yes, there should be some comments on this.
Just my opinion. I'd also personally prefer ISO C99 because it is
likely to be more portable (and nowadays should be supported on all
platforms...).
-Leif
> With best regards,
> Sergey mailto:[email protected]
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org