Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-trivial designated initializers not supported #8

Closed
jpetso opened this issue May 11, 2015 · 3 comments
Closed

Non-trivial designated initializers not supported #8

jpetso opened this issue May 11, 2015 · 3 comments

Comments

@jpetso
Copy link
Contributor

jpetso commented May 11, 2015

The other remaining issue with my Linux build (at least as far as I made it in the build) is this piece of code (from KeyStore.cc) and a similar one two functions down:

        fdb_doc doc = {
            .key = (void*)key.buf,
            .keylen = key.size,
            .meta = (void*)meta.buf,
            .metalen = meta.size,
            .body  = (void*)body.buf,
            .bodylen = body.size,
        };

Which g++ (GCC 4.9.2 20150304 (prerelease)) doesn't quite like too much:

FAILED: /usr/bin/c++    -std=c++11 -fomit-frame-pointer -O2 -g -DNDEBUG -I../vendor/forestdb/include -I.. -MMD -MT CMakeFiles/cbforest.dir/CBForest/KeyStore.cc.o -MF CMakeFiles/cbforest.dir/CBForest/KeyStore.cc.o.d -o CMakeFiles/cbforest.dir/CBForest/KeyStore.cc.o -c ../CBForest/KeyStore.cc
../CBForest/KeyStore.cc: In member function ‘forestdb::sequence forestdb::KeyStoreWriter::set(forestdb::slice, forestdb::slice, forestdb::slice)’:
../CBForest/KeyStore.cc:116:9: sorry, unimplemented: non-trivial designated initializers not supported
         };
         ^
../CBForest/KeyStore.cc: In member function ‘bool forestdb::KeyStoreWriter::del(forestdb::slice)’:
../CBForest/KeyStore.cc:149:9: sorry, unimplemented: non-trivial designated initializers not supported
         };
         ^

The reason is that this is not valid C++, neither C++11 nor C++14, although it is valid C99. (C++ initializer lists got adopted, but designated initializers didn't.) In the interest of portability, maybe it can be swapped out with something more standard.

@snej
Copy link
Contributor

snej commented May 11, 2015

Sure, could you send a pull request?

@jpetso
Copy link
Contributor Author

jpetso commented May 11, 2015

Thanks, added a commit to PR #6.

@jpetso
Copy link
Contributor Author

jpetso commented May 14, 2015

Fixed by commit 77c403c.

@jpetso jpetso closed this as completed May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants