On 5 January 2015 at 10:47, Greg Keogh <[email protected]> wrote:
>
> Folks, I might have to migrate some Embarcadero/Borland C (not C++) code
> over to Visual Studio, but I haven't written any C/C++ for about 10 years
> now (thankfully). The C code mostly manipulates flat files and performs
> heavy stats calculations, so there are no serious platform dependencies to
> make conversion difficult.


These two posts by Damien Katz (creator of CouchDB) are inspiring reading
if you are concerned that going back to C is a regression:

   - http://damienkatz.net/2013/01/the_unreasonable_effectiveness_of_c.html
   - http://damienkatz.net/2013/01/follow_up_to_the_unreasonable.html

His message is: C is exactly as high- or low-level as the libraries you are
using with it. If you think C is too low-level, then you are using the
wrong abstraction.

On 5 January 2015 at 19:15, Greg Harris <[email protected]>
wrote:

> Not being a C++ guy I can not tell you when the // style comment came in
> for C based languages :-)
>

C has supported "//" comments since C99[1].

However, Microsoft Visual C++ does not support C99 before version 2013, and
even in 2013 it only supports a subset of C99[2]. Still, I would be
flabbergasted if that subset did not include "//" comments.

Anyway, if "heavy stats calculations" means "heavy calculations on floating
point numbers", then that is an area where C99 does differ from C89,
especially with regard to rounding[3], which apparently had unspecified
semantics before the C99 standard.

You do want to check that MSVC++ 2013 is a reasonably compliant C99
compiler re IEEE 754 floats (it probably is because it includes
"fenv.h"[2][3]) so that irrespective of whether Borland's compiler is or is
not, you can reproduce the Borland compiler's behaviour using the new C99
macros (or fix previously unfixable rounding bugs with them!).

So you thought that there were no serious platform dependencies, eh?

[1] ISO/IEC 9899:1999, 6.4.9.2
[2]
http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx
[3] ISO/IEC 9899:1999, 7.6 and annex F

--
Thomas Koster

Reply via email to