diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Makefile.am | 4 | ||||
-rw-r--r-- | src/main/Makefile.in | 5 | ||||
-rw-r--r-- | src/main/main.cpp | 11 | ||||
-rw-r--r-- | src/main/util.cpp | 4 |
4 files changed, 15 insertions, 9 deletions
diff --git a/src/main/Makefile.am b/src/main/Makefile.am index f5b76fcfb..7c4f2d52d 100644 --- a/src/main/Makefile.am +++ b/src/main/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ -I@srcdir@/../include -I@srcdir@/.. -AM_CXXFLAGS = -Wall -fvisibility=hidden +AM_CXXFLAGS = -Wall bin_PROGRAMS = cvc4 @@ -15,3 +15,5 @@ cvc4_SOURCES = \ cvc4_LDADD = \ ../parser/libcvc4parser.la \ ../libcvc4.la + +cvc4_LINK = $(CXXLINK) diff --git a/src/main/Makefile.in b/src/main/Makefile.in index 58eeeacdd..8e2c49989 100644 --- a/src/main/Makefile.in +++ b/src/main/Makefile.in @@ -222,7 +222,7 @@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I@srcdir@/../include -I@srcdir@/.. -AM_CXXFLAGS = -Wall -fvisibility=hidden +AM_CXXFLAGS = -Wall cvc4_SOURCES = \ main.cpp \ getopt.cpp \ @@ -235,6 +235,7 @@ cvc4_LDADD = \ ../parser/libcvc4parser.la \ ../libcvc4.la +cvc4_LINK = $(CXXLINK) all: all-am .SUFFIXES: @@ -314,7 +315,7 @@ clean-binPROGRAMS: rm -f $$list cvc4$(EXEEXT): $(cvc4_OBJECTS) $(cvc4_DEPENDENCIES) @rm -f cvc4$(EXEEXT) - $(CXXLINK) $(cvc4_OBJECTS) $(cvc4_LDADD) $(LIBS) + $(cvc4_LINK) $(cvc4_OBJECTS) $(cvc4_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) diff --git a/src/main/main.cpp b/src/main/main.cpp index ba71b043f..6f32e474b 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -28,6 +28,7 @@ #include "expr/expr_manager.h" #include "smt/smt_engine.h" #include "util/command.h" +#include "util/Assert.h" #include "util/output.h" #include "util/options.h" @@ -55,7 +56,7 @@ int main(int argc, char *argv[]) { // We only accept one input file if(argc > firstArgIndex + 1) { - throw new Exception("Too many input files specified."); + throw Exception("Too many input files specified."); } // Create the expression manager @@ -144,8 +145,10 @@ int main(int argc, char *argv[]) { // Remove the parser delete parser; - // Delete handle to input file - delete file; + if(! inputFromStdin) { + // Delete handle to input file + delete file; + } } catch(OptionException& e) { if(options.smtcomp_mode) { cout << "unknown" << endl; @@ -153,7 +156,7 @@ int main(int argc, char *argv[]) { cerr << "CVC4 Error:" << endl << e << endl; printf(usage, options.binary_name.c_str()); abort(); - } catch(CVC4::Exception& e) { + } catch(Exception& e) { if(options.smtcomp_mode) { cout << "unknown" << endl; } diff --git a/src/main/util.cpp b/src/main/util.cpp index 9bb96d853..0b33b145d 100644 --- a/src/main/util.cpp +++ b/src/main/util.cpp @@ -46,14 +46,14 @@ void cvc4_init() throw() { act1.sa_flags = SA_SIGINFO; sigemptyset(&act1.sa_mask); if(sigaction(SIGINT, &act1, NULL)) - throw new Exception(string("sigaction(SIGINT) failure: ") + strerror(errno)); + throw Exception(string("sigaction(SIGINT) failure: ") + strerror(errno)); struct sigaction act2; act2.sa_sigaction = segv_handler; act2.sa_flags = SA_SIGINFO; sigemptyset(&act2.sa_mask); if(sigaction(SIGSEGV, &act2, NULL)) - throw new Exception(string("sigaction(SIGSEGV) failure: ") + strerror(errno)); + throw Exception(string("sigaction(SIGSEGV) failure: ") + strerror(errno)); } }/* CVC4::main namespace */ |