michaeljclark / rv8

RISC-V simulator for x86-64
https://michaeljclark.github.io/
MIT License
671 stars 97 forks source link

Compilation Failure on `sudo make` Due to Missing `<limits>` Include in Specific Files #68

Open Carlos12001 opened 6 months ago

Carlos12001 commented 6 months ago

Title:

Compilation Failure on sudo make Due to Missing <limits> Include in Specific Files

Description:

When attempting to compile the project using make with sudo, I encountered multiple compilation errors stating that 'numeric_limits' is not a member of 'std'. The errors occur in the files src/gen/gen-cc.cc and potentially others related to floating-point operations. It appears that the issue is due to the absence of the <limits> header in these files.

Steps to Reproduce:

  1. Navigate to the project root directory.
  2. Execute the command sudo make.

Expected Outcome:

The project compiles without any errors.

Actual Outcome:

Compilation fails with the following error messages:

src/gen/gen-cc.cc: In function ‘void typed_value_set(std::set<std::__cxx11::basic_string<char> >&, const rv_primitive_type*)’:
src/gen/gen-cc.cc:50:18: error: ‘numeric_limits’ is not a member of ‘std’
   50 |         if (std::numeric_limits<T>::is_signed) {
      |                  ^~~~~~~~~~~~~~
...

Proposed Solution:

Include <limits> in the affected files, specifically:

Additional Information: