about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-25 19:11:02 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-25 19:11:02 -0700
commitfb5a590d6739c55f0e7fbffe1e80f426cbdbc369 (patch)
tree7a78a3cdc4ba47ee447dd2b98820d4d749e6fe1e /subx
parentd9ea0ed1bc4dd53b102a8788120bc6b966c9f2f2 (diff)
downloadmu-fb5a590d6739c55f0e7fbffe1e80f426cbdbc369.tar.gz
4411
Port commit 4235 to subx.
Diffstat (limited to 'subx')
-rw-r--r--subx/001help.cc8
-rw-r--r--subx/003trace.cc2
-rw-r--r--subx/020elf.cc4
3 files changed, 9 insertions, 5 deletions
diff --git a/subx/001help.cc b/subx/001help.cc
index c5b16a39..b4d58de5 100644
--- a/subx/001help.cc
+++ b/subx/001help.cc
@@ -158,7 +158,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,4 +256,8 @@ using std::cerr;
 #include <string>
 using std::string;
 
-#define unused  __attribute__((unused))
+#define vestigial  __attribute__((unused))
+
+#include <algorithm>
+using std::min;
+using std::max;
diff --git a/subx/003trace.cc b/subx/003trace.cc
index d1c7ea17..120ada82 100644
--- a/subx/003trace.cc
+++ b/subx/003trace.cc
@@ -183,7 +183,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/subx/020elf.cc b/subx/020elf.cc
index 62743a98..ca7b2483 100644
--- a/subx/020elf.cc
+++ b/subx/020elf.cc
@@ -119,7 +119,7 @@ inline uint16_t u16_in(uint8_t* p) {
 :(before "End Types")
 struct perr {};
 :(code)
-ostream& operator<<(ostream& os, unused perr) {
+ostream& operator<<(ostream& os, vestigial perr) {
   if (errno)
     os << ": " << strerror(errno);
   return os;
@@ -128,7 +128,7 @@ ostream& operator<<(ostream& os, unused perr) {
 :(before "End Types")
 struct die {};
 :(code)
-ostream& operator<<(unused ostream& os, unused die) {
+ostream& operator<<(vestigial ostream&, vestigial die) {
   if (Trace_stream) Trace_stream->newline();
   exit(1);
 }