phillipstanleymarbell / Noisy-lang-compiler

Noisy language compiler
MIT License
17 stars 1 forks source link

Compilation errors with GCC 12 #611

Closed KomaGR closed 2 years ago

KomaGR commented 2 years ago

These are actually perhaps two different things. The latest version of GCC is complaining about a condition that always evaluates to true (which is an error due to our compilation flags). Moreover, it looks like GCC is no longer ok with using std::map without including <map>.

Host OS (please complete the following information):

Additional context Error from the condition:

common-utils.c: In function ‘error’:
common-utils.c:839:64: error: the comparison will always evaluate as ‘true’ for the address of ‘errstr’ will never be NULL [-Werror=address]
  839 |         if (N != NULL && N->Fe != NULL && (char*)N->Fe->errstr != NULL)
      |                                                                ^~
In file included from common-utils.c:60:
/home/koma/Noisy-lang-compiler/submodules/libflex/flex.h:189:25: note: ‘errstr’ declared here
  189 |         char            errstr[FLEX_ERRSTRLEN];
      |                         ^~~~~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-gnu-designator’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors

Errors related to std::map

newton-irPass-LLVMIR-dimension-check.cpp:97:6: error: ‘map’ in namespace ‘std’ does not name a template type
   97 | std::map<Value *, PhysicsInfo *> virtualRegisterPhysicsTable;
      |      ^~~
newton-irPass-LLVMIR-dimension-check.cpp:80:1: note: ‘std::map’ is defined in header ‘<map>’; did you forget to ‘#include <map>’?
   79 | #include "newton-irPass-invariantSignalAnnotation.h"
  +++ |+#include <map>
   80 | 
newton-irPass-LLVMIR-dimension-check.cpp: In function ‘void dimensionalityCheck(llvm::Function&, State*)’:
newton-irPass-LLVMIR-dimension-check.cpp:272:65: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  272 |                                                                 virtualRegisterPhysicsTable[localVariableAddress] = physicsInfo;
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:287:68: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  287 |                                         PhysicsInfo *   leftTerm = virtualRegisterPhysicsTable[llvmIrInstruction.getOperand(0)];
      |                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:321:76: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  321 |                                                 PhysicsInfo *   leftTerm = virtualRegisterPhysicsTable[llvmIrBinaryOperator->getOperand(0)];
      |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:357:76: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  357 |                                                 PhysicsInfo *   leftTerm = virtualRegisterPhysicsTable[llvmIrBinaryOperator->getOperand(0)];
      |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:392:49: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  392 |                                                 virtualRegisterPhysicsTable.insert({llvmIrLoadInstruction, virtualRegisterPhysicsTable[llvmIrLoadInstruction->getOperand(0)]});
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:401:83: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  401 |                                                 PhysicsInfo *   leftPhysicsInfo = virtualRegisterPhysicsTable[leftTerm];
      |                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:454:111: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  454 |                                                         PhysicsInfo     *       structurePointerPhysicsInfo = virtualRegisterPhysicsTable[structurePointer];
      |                                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
newton-irPass-LLVMIR-dimension-check.cpp:482:41: error: ‘virtualRegisterPhysicsTable’ was not declared in this scope
  482 |                                         virtualRegisterPhysicsTable.insert({&llvmIrInstruction, virtualRegisterPhysicsTable[llvmIrInstruction.getOperand(0)]});