cpc / openasip

Open Application-Specific Instruction Set processor tools (OpenASIP)
http://openasip.org
Other
143 stars 43 forks source link

Use cpp headers over system headers #221

Closed sarahec closed 1 year ago

sarahec commented 1 year ago

This replaces system headers such as <math.h> with the corresponding C++ header (<cmath>) ni C++ code.

Each of the compiler suites includes its own c++ headers, and there's a risk of the system headers differing from these and causing subtle bugs.

sarahec commented 1 year ago

The formatting script is sorting the headers and re-wrapped some lines in base.cc and double.cc. Please take a look.

sarahec commented 1 year ago

Fixes applied

sarahec commented 1 year ago

Changes in the force-pushed update:

  1. Reverted all of newlib (copied over from main)
  2. Reverted base.cc and double.cc (copied from main), then changed the header and added using namespace std. No other formatting changes applied.
  3. Squashed and force-pushed the combined commits to make the merge cleaner. Here's the diff link for your review.
pjaaskel commented 1 year ago

Did you run the tests? There seem to be a couple of cases which are compiled with the oacc's (incomplete C++ support), which doesn't yet have a stdlib.

<system_testing errors with Current shell environment. With revision a0b8a6fcaa7b46c131bbf4684974a38b07c2d3c1.>
[349637] ./procgen/hpu/test_hpu_embedded.testdesc: half-precision FPUs by generating and simulating a processor...FAIL (0m0.569s)
[349645] ./bintools/Compiler/RegressionTests/bool_return_value.testdesc: Test that boolean return values work...FAIL (0m0.436s)
Differences found against verification data are stored into difference.txt
</system_testing errors with Current shell environment. With revision a0b8a6fcaa7b46c131bbf4684974a38b07c2d3c1.>

Here's the info for how to run the tests if you haven't before: https://github.com/cpc/openasip/wiki/Contributor-Info

sarahec commented 1 year ago

Thank you. I had been running tests from the test directory and missed that there's a test driver script. It's also flagging problems I hadn't seen earlier.

This may take some time, as compiletest isn't passing on a fresh checkout of the project.

sarahec commented 1 year ago

Filed #223 which is blocking resolution of the above question.

sarahec commented 1 year ago

I'm going to close this for now and come back when I have a reliable testing setup.