]> git.ozlabs.org Git - ccan/commit
opt: Fix -Wmissing-field-initializers warning
authorJoel Stanley <joel@jms.id.au>
Mon, 7 Feb 2011 04:06:15 +0000 (14:36 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 7 Feb 2011 04:34:52 +0000 (15:04 +1030)
commitb30c544bd1486e7b60b99259e3d0dcbc1ec9efd0
tree2753f47fcf6facdf3084c0aafeda90e1e0f11162
parent4250928271d51476f63b0d7c5dfe687728cc1d95
opt: Fix -Wmissing-field-initializers warning

OPT_ENDTABLE does not initalise all the elements in stuct opt_table.
When compliling with -Wextra -Wmissing-field-initializers is enabled,
which produces the following warning:

        iviewiir.c:299:9: error: missing field 'cb' initializer
              [-Wmissing-field-initializers]
                OPT_ENDTABLE
                ^
        In file included from iviewiir.c:12:
        ./ccan/opt/opt.h:82:38: note: instantiated from:
        #define OPT_ENDTABLE { NULL, OPT_END }
                                             ^
By changing the definition of OPT_ENDTABLE to initalise all 7 elements
of struct opt_table, the warning is silenced.
ccan/opt/opt.h