octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42704] mkoctfile returns 0 if compile failed


From: Andreas Weber
Subject: [Octave-bug-tracker] [bug #42704] mkoctfile returns 0 if compile failed but linking succeeded
Date: Tue, 08 Jul 2014 11:21:23 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 Iceweasel/30.0

Follow-up Comment #1, bug #42704 (project octave):

hm, there seems to be a problem with savannah and I'll try to add the code
again:

hello.cc:

#include <iostream>
int main()
{
  std::cout << "hello bug hunter..." << std::endl;
  return 0;
}


now compile with mkoctfile:

$ mkoctfile -v hello.cc 

cmd = ccache g++ -c  -fPIC -I/usr/local/include/octave-4.1.0+/octave/..
-I/usr/local/include/octave-4.1.0+/octave -I/usr/local/include  -g -O2
-pthread    hello.cc -o hello.o
result = 0
cmd = ccache g++ -shared -Wl,-Bsymbolic  -o hello.oct  hello.o  
-L/usr/local/lib/octave/4.1.0+ -L/usr/local/lib -loctinterp -loctave   
result = 0


All went fine as expected. Now add a syntax error to hello.cc and run
mkoctfile again:


$ mkoctfile -v hello.cc 
cmd = ccache g++ -c  -fPIC -I/usr/local/include/octave-4.1.0+/octave/..
-I/usr/local/include/octave-4.1.0+/octave -I/usr/local/include  -g -O2
-pthread    hello.cc -o hello.o
hello.cc: In function ‘int main()’:
hello.cc:5:3: error: ‘xyz’ was not declared in this scope
   xyz
   ^
result = 256
cmd = ccache g++ -shared -Wl,-Bsymbolic  -o hello.oct  hello.o  
-L/usr/local/lib/octave/4.1.0+ -L/usr/local/lib -loctinterp -loctave   
result = 0

$ echo $?
0


As you can see g++ failed and returned 256 but mkoctfile nevertheless tries to
link hello.o which succeeds and returns 0 therefore.

-- Andy

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42704>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]