From f61fec22c57591cca36aae67775c4cd52a5411bc Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 11 Oct 2014 02:09:10 -0700 Subject: [PATCH] Correct "error: taking address of temporary array". --- Console.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Console.cpp b/Console.cpp index 209eef3..2b68edd 100644 --- a/Console.cpp +++ b/Console.cpp @@ -403,7 +403,8 @@ class History { ~History() { if (append_history$ != NULL) { - _syscall(close(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600)))); + int fd(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600))); + _syscall(close(fd)); _assert((*append_history$)(histlines_, histfile_.c_str()) == 0); } else { _assert(write_history(histfile_.c_str()) == 0); @@ -633,7 +634,7 @@ int Main(int argc, char * const argv[], char const * const envp[]) { #endif "r:" "s" - , (struct option[]) { + , (const struct option[]) { {NULL, no_argument, NULL, 'c'}, {NULL, required_argument, NULL, 'g'}, {NULL, required_argument, NULL, 'n'}, -- 2.49.0