• Sergey Avseyev's avatar
    Remove unnecessary const qualifier from cast (#4666) · 6b3f057b
    Sergey Avseyev authored
    Const does not make sense here, and compiler actually throws warning
    (error with -Werror) when you would try to compile it.
    
        In file included from include/flatbuffers/flexbuffers.h:24,
                         from include/flatbuffers/idl.h:26,
                         from include/flatbuffers/code_generators.h:22,
                         from src/code_generators.cpp:17:
        include/flatbuffers/util.h: In function ‘int flatbuffers::FromUTF8(const char**)’:
        include/flatbuffers/util.h:325:44: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
           if ((static_cast<const unsigned char>(tmp) << len) & 0x80) return -1;  // Bit after leading 1's must be 0.
                                                ^
        cc1plus: all warnings being treated as errors
    
    This warning caught by gcc8:
    
        $ g++ --version
        g++ (GCC) 8.0.1 20180222 (Red Hat 8.0.1-0.16)
    6b3f057b
Name
Last commit
Last update
.github Loading commit data...
.travis Loading commit data...
CMake Loading commit data...
android Loading commit data...
biicode Loading commit data...
docs Loading commit data...
go Loading commit data...
grpc Loading commit data...
include/flatbuffers Loading commit data...
java/com/google/flatbuffers Loading commit data...
js Loading commit data...
net/FlatBuffers Loading commit data...
php Loading commit data...
python Loading commit data...
reflection Loading commit data...
samples Loading commit data...
src Loading commit data...
tests Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
BUILD Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE.txt Loading commit data...
WORKSPACE Loading commit data...
appveyor.yml Loading commit data...
biicode.conf Loading commit data...
composer.json Loading commit data...
conanfile.py Loading commit data...
package.json Loading commit data...
pom.xml Loading commit data...
readme.md Loading commit data...