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

Multiple build failures with recent commits #52

Closed
apurvam opened this issue Aug 23, 2014 · 4 comments
Closed

Multiple build failures with recent commits #52

apurvam opened this issue Aug 23, 2014 · 4 comments

Comments

@apurvam
Copy link

apurvam commented Aug 23, 2014

I am using a vanilla version of gcc 4.8.3 and recent commits to flatbuffers have caused builds to fail:

First off, commit ebac1e1 caused this build failure:

[  7%] Building CXX object CMakeFiles/flatc.dir/src/idl_parser.cpp.o
In file included from /home/amehta/workspace/external/flatbuffers/src/idl_parser.cpp:21:0:
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/util.h: In function ‘int flatbuffers::ToUTF8(uint32_t, std::string*)’:
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/util.h:157:29: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (ucc < (1 << max_bits)) {  // does it fit?
                             ^
cc1plus: all warnings being treated as errors

This is pretty easy to fix if we cast the comparison explicitly, ie.

  if (ucc < static_cast<uint32_t>(1 << max_bits)) {  // does it fit?

However, it is not clear to me why the original code failed nor why this cast would fix it. That is why I didn't create a pull request with the patch.

Secondly, commit 11b7436 caused this failure:

[amehta@amehta-ld1 build]$ make
Scanning dependencies of target flatc
[  7%] Building CXX object CMakeFiles/flatc.dir/src/idl_parser.cpp.o
[ 15%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_cpp.cpp.o
[ 23%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_java.cpp.o
[ 30%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_go.cpp.o
[ 38%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_text.cpp.o
[ 46%] Building CXX object CMakeFiles/flatc.dir/src/flatc.cpp.o
Linking CXX executable flatc
[ 46%] Built target flatc
Scanning dependencies of target flatsamplebinary
[ 53%] Building CXX object CMakeFiles/flatsamplebinary.dir/samples/sample_binary.cpp.o
In file included from /home/amehta/workspace/external/flatbuffers/samples/sample_binary.cpp:19:0:
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h: In member function ‘bool MyGame::Sample::Monster::Verify(const flatbuffers::Verifier&) const’:
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h:65:32: error: ‘VerifyTable’ was not declared in this scope
     return VerifyTable(verifier) &&
                                ^
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h: In function ‘bool MyGame::Sample::VerifyAny(const flatbuffers::Verifier&, const void*, uint8_t)’:
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h:111:95: error: no matching function for call to ‘flatbuffers::Verifier::VerifyTable(const MyGame::Sample::Monster*) const’
     case Any_Monster: return verifier.VerifyTable(reinterpret_cast<const Monster *>(union_obj));
                                                                                               ^
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h:111:95: note: candidate is:
In file included from /home/amehta/workspace/external/flatbuffers/samples/sample_binary.cpp:17:0:
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/flatbuffers.h:693:29: note: bool flatbuffers::Verifier::VerifyTable(const T*) [with T = MyGame::Sample::Monster] <near match>
   template<typename T> bool VerifyTable(const T *table) {
                             ^
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/flatbuffers.h:693:29: note:   no known conversion for implicit ‘this’ parameter from ‘const flatbuffers::Verifier*’ to ‘flatbuffers::Verifier*’
In file included from /home/amehta/workspace/external/flatbuffers/samples/sample_binary.cpp:19:0:
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h: In function ‘bool MyGame::Sample::VerifyMonsterBuffer(const flatbuffers::Verifier&)’:
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h:118:112: error: no matching function for call to ‘flatbuffers::Verifier::VerifyBuffer() const’
 inline bool VerifyMonsterBuffer(const flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer<Monster>(); }
                                                                                                                ^
/home/amehta/workspace/external/flatbuffers/samples/monster_generated.h:118:112: note: candidate is:
In file included from /home/amehta/workspace/external/flatbuffers/samples/sample_binary.cpp:17:0:
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/flatbuffers.h:748:29: note: bool flatbuffers::Verifier::VerifyBuffer() [with T = MyGame::Sample::Monster] <near match>
   template<typename T> bool VerifyBuffer() {
                             ^
/home/amehta/workspace/external/flatbuffers/include/flatbuffers/flatbuffers.h:748:29: note:   no known conversion for implicit ‘this’ parameter from ‘const flatbuffers::Verifier*’ to ‘flatbuffers::Verifier*’
make[2]: *** [CMakeFiles/flatsamplebinary.dir/samples/sample_binary.cpp.o] Error 1
make[1]: *** [CMakeFiles/flatsamplebinary.dir/all] Error 2
make: *** [all] Error 2

I have not been able to successfully debug this. Any help would be appreciated!

@ghost
Copy link

ghost commented Aug 23, 2014

The first error is because 1 is by default unsigned, so instead writing 1u may also fix it.

The second errors are caused by me forgetting to regenerate monster_generated.h. Please run flatc -c monster.fbs in samples/.

Will fix these both on Monday, thanks for noticing.

@apurvam
Copy link
Author

apurvam commented Aug 23, 2014

Yep I realized it after typing. I just created a pull request with the patch for the first error.

@apurvam
Copy link
Author

apurvam commented Aug 25, 2014

I submitted pull request #53 which fixes both errors.

@apurvam apurvam closed this as completed Aug 25, 2014
@ghost
Copy link

ghost commented Aug 25, 2014

Ahh thanks.. already made a commit though that fixes this.

kakikubo pushed a commit to kakikubo/flatbuffers that referenced this issue Apr 19, 2016
webview更新スクリプト
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

1 participant