- From: alan.garny at dpag.ox.ac.uk (Alan Garny)
- Subject: [cellml-dev] FW: r1791 - simple_interface_generators/trunk/glue/xpcom
- Date: Wed, 26 Sep 2007 09:07:50 +0100
>
> printf is ANSI C whereas cstdio is only in ISO/ANSI C++. The informal
>
> (which I eventually plan to write up) style is to use ANSI C headers
>
> where they exist to minimise any efforts to port parts of the code which
>
> don't use C++ features between C and C++. This is a policy which we
>
> could review if, for example, we wanted to use conflicting names and
>
> benefit from namespaces.
>
>
Just to clarify, since the particular file is c++, the style you mention
>
would then advocate using cstdio wouldn't it?
That's what I would think too...
>
> If we do this, this is far from the only place we would have to change.
>
>
If we do change a style policy, I think it is better to say that we will
>
start following that policy from now on for new code we write, and change
>
code that we see that is not longer compliant if we are working on it.
>
Fixing all historic deviations can be done if we ever have nothing else to
>
do. I know it means one sees code that follows contradictory styles, but
it
>
allows one to continually improve the style, rather than being stuck on
>
previous decision forever.
I believe that is what we agreed to do when I was still in Auckland.
>
> abort is an alternative option, although it is not quite as portable (it
>
> is in C99 and POSIX, although some older platforms might struggle with
>
> this).
>
>
Regarding portability of abort(), there is a trade-off between cleaner
code
>
and portability. My feeling is that we should be on the side of that
>
trade-off that favours the use of abort().
Portability is important to me. If anything, we could always make a comment
that mentions the cleaner, but less portable, code?
Alan.
Archive powered by MHonArc 2.6.18.