Skip to content

codeguidelines.py does not handle compiler-specific code #3

@pavelkryukov

Description

@pavelkryukov
$ git diff -- simulator/mips/mips_instr.cpp
diff --git a/simulator/mips/mips_instr.cpp b/simulator/mips/mips_instr.cpp
index 6d0c88c..03c5bff 100644
--- a/simulator/mips/mips_instr.cpp
+++ b/simulator/mips/mips_instr.cpp
@@ -10,6 +10,21 @@

 #include "mips_instr.h"

+struct Dummy {
+    size_t var;
+    void func() {
+#if defined(__clang__) || defined(_MSC_VER)
+        try {
+            var = std::strlen("hgjkdhgjkhdfjkgh");
+        }
+        catch (...) {
+            std::cerr << "exception";
+        }
+#endif
+        var = 324;
+    }
+}
+
 //unordered map for R-instructions
 const std::unordered_map <uint8, FuncInstr::ISAEntry> FuncInstr::isaMapR =
 {
$ git add simulator/mips/mips_instr.cpp
$ git commit -m "test commit"
[detached HEAD 532bd9c] test commit
 1 file changed, 15 insertions(+)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions