0

I am working with c++ for mathematical academical purpose and found a useful package from 2003. And I need to estimate if this program is useful. (I am talking about the VISPACK library http://www.cs.utah.edu/~whitaker/vispack/) I will be working with windows7.

Is it so far realizable to use this project completely? Do I need to set all my compiling properties in CMake and Eclipse to a 2003 standard?? Or is it ok to use VS2010? Do you think it is "more work" or "not possible" ?

Rea
  • 268
  • 3
  • 9
  • 5
    Unless the author used code that was never really valid C++ (even for 2003), you should be ok. Any compilation errors encountered should be minor to fix. – PaulMcKenzie Sep 24 '15 at 16:33
  • You may be interested in the [list of breaking changes in C++11](http://stackoverflow.com/questions/6399615/what-breaking-changes-are-introduced-in-c11) and the [list of breaking changes in C++14](http://stackoverflow.com/questions/23980929/what-changes-introduced-in-c14-can-potentially-break-a-program-written-in-c1). – jaggedSpire Sep 24 '15 at 16:37
  • You should be able to compile standard C++03 code with C++11/14. The code might even run faster as the standard libraries implement move semantics. – NathanOliver Sep 24 '15 at 16:38
  • The library should include unit tests which will determine if it works after compilation. Or is this just wishful thinking? – Anon Mail Sep 24 '15 at 16:42
  • Also see [Can C++ code be valid in both C++03 and C++11 but do different things?](http://stackoverflow.com/questions/23047198/can-c-code-be-valid-in-both-c03-and-c11-but-do-different-things/23063914#23063914) – Shafik Yaghmour Sep 24 '15 at 17:19

1 Answers1

4

Unless the author used code that was never really valid C++ (even for 2003), you should be ok as far as compiling and building the library. If you do run into any compilation errors, it should be a minor fix to get rid of the errors.


However, one thing you may encounter (hopefully you won't) is that the program may give different results, have bugs, etc.

If this is the case, this would usually mean that the author used C++ that may be valid syntactically, but either produces undefined behavior or other scenario that is not desirable. If this occurs, you would need to debug the code to see where it goes wrong. Many times, a newer compiler/linker will produce an executable that exposes an undiscovered / hidden bug that was always lurking in the program.

Another possible but more rare scenario is where the programmer is using valid C++ syntax that has well-defined behavior for C++03, but behaves differently for C++11 or C++14. The link in the comments by @ShafikYaghmour discusses this.

PaulMcKenzie
  • 31,493
  • 4
  • 19
  • 38