A list for the developers of CellML tools

Text archives Help


[cellml-dev] FW: r1791 - simple_interface_generators/trunk/glue/xpcom


Chronological Thread 
  • From: r.britten at auckland.ac.nz (Randall Britten)
  • Subject: [cellml-dev] FW: r1791 - simple_interface_generators/trunk/glue/xpcom
  • Date: Wed, 26 Sep 2007 20:01:46 +1200

Andrew Miller wrote:
> 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?

> 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.

> 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().






Archive powered by MHonArc 2.6.18.

Top of page