about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2018-04-20 00:06:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2018-04-20 00:06:38 -0700
commit26a5d50613a3c6cc60f9b6206df15772964eb853 (patch)
treea1bb5b80290a424dbdc436c0a125b4aba6cef697
parent8878326574db7c121ce1bc06b3014eb1986946cc (diff)
downloadmu-26a5d50613a3c6cc60f9b6206df15772964eb853.tar.gz
4235 - fix a build issue for Apple clang 900.0.38
The trouble with rewriting 'unused' to '__attribute__(unused)' is that
if we happen to deliberately introduce '__attribute__(unused)' somehow,
say in the standard headers, then it gets expanded twice to '__attribute__(__attribute__(unused))'.
So we switch to a synonym.
-rw-r--r--001help.cc4
-rw-r--r--003trace.cc2
-rw-r--r--030container.cc2
-rw-r--r--056shape_shifting_recipe.cc4
-rw-r--r--073scheduler.cc2
5 files changed, 7 insertions, 7 deletions
diff --git a/001help.cc b/001help.cc
index a5be8c6b..14c492a8 100644
--- a/001help.cc
+++ b/001help.cc
@@ -157,7 +157,7 @@ void initialize_signal_handlers() {
   sigaction(SIGABRT, &action, NULL);  // assert() failure or integer overflow on linux (with -ftrapv)
   sigaction(SIGILL,  &action, NULL);  // integer overflow on OS X (with -ftrapv)
 }
-void dump_and_exit(int sig, unused siginfo_t* dummy1, unused void* dummy2) {
+void dump_and_exit(int sig, vestigial siginfo_t* dummy1, vestigial void* dummy2) {
   switch (sig) {
     case SIGABRT:
       #ifndef __APPLE__
@@ -256,7 +256,7 @@ using std::cerr;
 #include <string>
 using std::string;
 
-#define unused  __attribute__((unused))
+#define vestigial  __attribute__((unused))
 
 #include <algorithm>
 using std::min;
diff --git a/003trace.cc b/003trace.cc
index 7c9801e8..92a6d069 100644
--- a/003trace.cc
+++ b/003trace.cc
@@ -202,7 +202,7 @@ bool trace_contains_errors() {
 :(before "End Types")
 struct end {};
 :(code)
-ostream& operator<<(ostream& os, unused end) {
+ostream& operator<<(ostream& os, vestigial end) {
   if (Trace_stream) Trace_stream->newline();
   return os;
 }
diff --git a/030container.cc b/030container.cc
index d29976ea..2ee8351d 100644
--- a/030container.cc
+++ b/030container.cc
@@ -761,7 +761,7 @@ Transform.push_back(expand_type_abbreviations_in_containers);  // idempotent
 :(code)
 // extremely inefficient; we process all types over and over again, once for every single recipe
 // but it doesn't seem to cause any noticeable slowdown
-void expand_type_abbreviations_in_containers(unused const recipe_ordinal r) {
+void expand_type_abbreviations_in_containers(vestigial const recipe_ordinal r) {
   for (map<type_ordinal, type_info>::iterator p = Type.begin();  p != Type.end();  ++p) {
     for (int i = 0;  i < SIZE(p->second.elements);  ++i)
       expand_type_abbreviations(p->second.elements.at(i).type);
diff --git a/056shape_shifting_recipe.cc b/056shape_shifting_recipe.cc
index bbea9e1e..29d443c2 100644
--- a/056shape_shifting_recipe.cc
+++ b/056shape_shifting_recipe.cc
@@ -205,7 +205,7 @@ bool contains_type_ingredient_name(const type_tree* type) {
   return contains_type_ingredient_name(type->left) || contains_type_ingredient_name(type->right);
 }
 
-int number_of_concrete_type_names(unused const instruction& inst, recipe_ordinal r) {
+int number_of_concrete_type_names(vestigial const instruction& inst, recipe_ordinal r) {
   const recipe& caller = get(Recipe, r);
   int result = 0;
   for (int i = 0;  i < SIZE(caller.ingredients);  ++i)
@@ -223,7 +223,7 @@ int number_of_concrete_type_names(const type_tree* type) {
        + number_of_concrete_type_names(type->right);
 }
 
-int number_of_type_ingredients(unused const instruction& inst, recipe_ordinal r) {
+int number_of_type_ingredients(vestigial const instruction& inst, recipe_ordinal r) {
   const recipe& caller = get(Recipe, r);
   int result = 0;
   for (int i = 0;  i < SIZE(caller.ingredients);  ++i)
diff --git a/073scheduler.cc b/073scheduler.cc
index 51b3584f..75a17d33 100644
--- a/073scheduler.cc
+++ b/073scheduler.cc
@@ -312,7 +312,7 @@ def f2 [
 +error: f2: divide by zero in '3:num <- divide-with-remainder 4, 0'
 -error: f2: divide by zero in '4:num <- divide-with-remainder 4, 0'
 
-:(after "operator<<(ostream& os, unused end)")
+:(after "operator<<(ostream& os, vestigial end)")
   if (Trace_stream && Trace_stream->curr_label == "error" && Current_routine) {
     Current_routine->state = COMPLETED;
   }