peterGraf / pbl

PBL is an MIT License open source C-language library of functions that can be used in a C or C++ project. PBL is highly portable and compiles warning free on Linux gcc, MAC OS X and Windows Microsoft Visual C++ 2010 Express Edition.
http://www.mission-base.com/peter/source/
MIT License
40 stars 12 forks source link

Build warnings and test failure #5

Closed KingDuckZ closed 8 years ago

KingDuckZ commented 8 years ago

Hi, I've imported your project into mine, thanks for this useful library. I had to write a CMake file to have an easier time embedding pbl into my project (feel free to copy it), so there could be mistakes in my build options, although nothing that I can spot. Whatever the cause, from the build log here if you scroll down to where pblkf.c gets compiled you will see I'm getting a bunch of warnings. I'm getting the same warnings on Gentoo 64 bit and ArchLinux ARM 32 and 64 bit. Not sure if this is related to the warnings I'm getting, but if you scroll all the way down you will see that kfblockprint test is failing, which is causing my build to fail and turn red. As a workaround I could disable tests for pbl (I'm not using the part of pbl that fails, afaict), but it would be really nice if you could have a look into this.

Edit: Sorry, I just realized I couldn't simply run tests by invoking them, I had to pass them some command line arguments as well. Also some binaries were not run by the original makefile (pblkfblockprint among the others), so I'm also removing them from my cmake file. I've made some changes and I've got these tests failing now:

It might be a path issue, but if I try running the pbliftst binary manually and I paste the command "open isamtest/0002main 0002key0,0002dup1,0002key2 1" I get this output:

$ ./pbliftst

##command:
open isamtest/0002main 0002key0,0002dup1,0002key2 1
# open filename keyfile1,dkeyfile2,... update
# pblIsamOpen( isamtest/0002main, 3, 1 )
# not ok! pbl_errno 1021, errno 2

Edit 2: I think I managed to fix all the failing tests. Failures where not caused by problems in the code, but by wrong paths and a non-empty isamtest directory. I updated my CMake script so failures should not be happening anymore. However, it would still be very nice if you could have a look at the compiler's warnings.

peterGraf commented 8 years ago

Hello,

Hmm, strange issue, I had to install Ubuntu 16_4 before I could reproduce it, but now it is fixed, this is what I get on Ubuntu 16_4 as build output.

peter@ubuntu-16-04:~/pbl-master/src/src$ make gcc -Wall -O3 -I. -DPBLTEST -c -o pblStringBuilder.o pblStringBuilder.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblPriorityQueue.o pblPriorityQueue.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblHeap.o pblHeap.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblMap.o pblMap.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblSet.o pblSet.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblList.o pblList.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblCollection.o pblCollection.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblIterator.o pblIterator.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblisam.o pblisam.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblkf.o pblkf.c gcc -Wall -O3 -I. -DPBLTEST -c -o pblhash.o pblhash.c gcc -Wall -O3 -I. -DPBLTEST -c -o pbl.o pbl.c /usr/bin/ar rc libpbl.a pblStringBuilder.o pblPriorityQueue.o pblHeap.o pblMap.o pblSet.o pblList.o pblCollection.o pblIterator.o pblisam.o pblkf.o pblhash.o pbl.o /usr/bin/ar ts libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblhttst.o pblhttst.c gcc -O2 -o pblhttst pblhttst.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblkftst.o pblkftst.c gcc -O2 -o pblkftst pblkftst.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pbliftst.o pbliftst.c gcc -O2 -o pbliftst pbliftst.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblkfblockprint.o pblkfblockprint.c gcc -O2 -o pblkfblockprint pblkfblockprint.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblListTest.o pblListTest.c gcc -O2 -o pblListTest pblListTest.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblSetTest.o pblSetTest.c gcc -O2 -o pblSetTest pblSetTest.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblPerform.o pblPerform.c gcc -O2 -o pblPerform pblPerform.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblMapTest.o pblMapTest.c gcc -O2 -o pblMapTest pblMapTest.o libpbl.a gcc -Wall -O3 -I. -DPBLTEST -c -o pblPriorityQueueTest.o pblPriorityQueueTest.c gcc -O2 -o pblPriorityQueueTest pblPriorityQueueTest.o libpbl.a

KingDuckZ commented 8 years ago

Brilliant, thanks for reacting so quickly! My build is all nice now! :)

It's probably a warning that came with the newer versions of gcc. Even though the build server is Ubuntu 14, I put a recent gcc on it, or my code wouldn't build (something to do with C++11).

As of the cmake script, I made some changes so I just run some of the generated binaries and invoke them with the right arguments. See the full list here. That got me past some tests that would block forever waiting for stdin. Again, feel free to add it directly to your project if you think it's a nice thing to have. I can help fixing issues if it doesn't work out of the box.