SWI-Prolog / packages-cpp

The SWI-Prolog C++ interface
30 stars 14 forks source link

Simplify blob interface (PlBlob) #49

Closed kamahen closed 1 year ago

kamahen commented 1 year ago
kamahen commented 1 year ago

This PR breaks the pending PR for rocksdb - https://github.com/JanWielemaker/rocksdb/pull/18 (I think it still works with the current head but am not 100% sure) I'll be adding to the pending PR as soon as I figure out why the ASAN test is failing - the backtrace I'm getting looks like it shouldn't be a problem and the error message is confusing and not documented.

kamahen commented 1 year ago
Something has broken when I did a `git pull` ... not clear what. :( Will update this when I've figured out the problem and pushed a new commit.
kamahen commented 1 year ago

(fixed the bug)

kamahen commented 1 year ago

Please don't merge yet ... I have one more change that needs to be pushed, but it's not ready yet.

kamahen commented 1 year ago

That's my last change for now - ready for review. pack(rocksdb) and pack(hdt) have been updated to use my changes. Other code that uses SWI-cpp2.h doesn't require changes (swipl-win, rolog) don't need modification.

JanWielemaker commented 1 year ago

Thanks. Merged after fixing some LaTeX error and a few (void)var to deal with unused variables if they are only used on assert().

kamahen commented 1 year ago

Hmmm ... I wonder why the LaTeX errors didn't show when I did my build. What options do you use to get the "unused variables" error?

JanWielemaker commented 1 year ago

Hmmm ... I wonder why the LaTeX errors didn't show when I did my build.

Because the normal build only generates the HTML from the LaTeX using Prolog. That is less critical. For the whole thing, see CMAKE.md and see the Debian requirements page for what needs to be installed (costs a lot of disk space)

What options do you use to get the "unused variables" error?

-DNDEBUG, used by some compiler by default on release builds. That removes assert() calls, so if the assert() call is the only thing using a variable, it becomes unused. Putting (void)var after the assert() works well. Of course, you may decide not to compute the value either. If it is just the assignment, I assume the compiler will remove the variable anyway.