]> git.jsancho.org Git - lugaru.git/commit
Fix mismatched usage length, build fail on g++
authorMartin Erik Werner <martinerikwerner@gmail.com>
Wed, 8 Mar 2017 21:51:16 +0000 (22:51 +0100)
committerMartin Erik Werner <martinerikwerner@gmail.com>
Wed, 8 Mar 2017 22:19:53 +0000 (23:19 +0100)
commitdd685fe9080c2853422d8272792691358ea07dfc
tree57782f6a75b2a0b59e1b0173765004d239e7713c
parentce51a88a16d2e7af222929546d250eba4acb299d
Fix mismatched usage length, build fail on g++

The length of const option::Descriptor usage[] is intended to be
inferred based on the initialisation in Source/main.cpp, however, the
extern declaration in Source/Game.hpp hard-codes it to 13.

Remove the hard-coded 13 in the extern declaration, in favour of the
inferred length.

This also fixes the follwoing build failure with g++ (Debian 4.9.2-10)
4.9.2:
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::index’
     };
     ^
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::index’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::type’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::type’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::shortopt’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::shortopt’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::longopt’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::longopt’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: error: uninitialized const member ‘option::Descriptor::check_arg’
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::check_arg’ [-Wmissing-field-initializers]
(...)/Source/main.cpp:602:5: warning: missing initializer for member ‘option::Descriptor::help’ [-Wmissing-field-initializers]
CMakeFiles/lugaru.dir/build.make:54: recipe for target 'CMakeFiles/lugaru.dir/Source/main.cpp.o' failed

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Source/Game.hpp