1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
commit 660bd0360e5ef0248201db744593a2d8b3b21c04
Author: Palmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>
Date: Mon Nov 24 10:36:14 2014 -0800
Various -Wextra fixups
It appears that some more errors have either creeped into the Chisel
C++ header files or into GCC's "-Wextra -pedantic" set. This patch
uses the same techniques as last time to hide these new errors.
diff --git a/src/main/resources/emulator_api.h b/src/main/resources/emulator_api.h
index 8f411da..b287469 100644
--- a/src/main/resources/emulator_api.h
+++ b/src/main/resources/emulator_api.h
@@ -4,6 +4,12 @@
#include "emulator_mod.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+
#include <string>
#include <sstream>
#include <map>
@@ -23,7 +29,7 @@ static std::string itos(int in) {
* Copy one val_t array to another.
* nb must be the exact number of bits the val_t represents.
*/
-static void val_cpy(val_t* dst, val_t* src, int nb) {
+static __attribute__((unused)) void val_cpy(val_t* dst, val_t* src, int nb) {
for (int i=0; i<val_n_words(nb); i++) {
dst[i] = src[i];
}
@@ -44,7 +50,7 @@ static void val_empty(val_t* dst, int nb) {
* is capped by the width of a single val_t element.
* nb must be the exact number of bits the val_t represents.
*/
-static void val_set(val_t* dst, val_t nb, val_t num) {
+static __attribute__((unused)) void val_set(val_t* dst, val_t nb, val_t num) {
val_empty(dst, nb);
dst[0] = num;
}
@@ -660,4 +666,6 @@ protected:
std::map<std::string, mod_t*> snapshot_table;
};
+#pragma GCC diagnostic pop
+
#endif
diff --git a/src/main/resources/emulator_mod.h b/src/main/resources/emulator_mod.h
index 994ddba..3c76b6b 100644
--- a/src/main/resources/emulator_mod.h
+++ b/src/main/resources/emulator_mod.h
@@ -5,6 +5,7 @@
#define __IS_EMULATOR_MOD__
#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wparentheses"
@@ -13,6 +14,9 @@
#pragma GCC diagnostic ignored "-Wtype-limits"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wreorder"
+#pragma GCC diagnostic ignored "-Wsometimes-uninitialized"
+#pragma GCC diagnostic ignored "-pedantic"
#include <assert.h>
#include <inttypes.h>
@@ -1564,7 +1568,7 @@ class mem_t {
}
};
-static char hex_to_char[] = "0123456789abcdef";
+static __attribute__((unused)) char hex_to_char[] = "0123456789abcdef";
static int char_to_hex[] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
|