Thank you for all, I have found root cause: the "struct ovsdb_idl" is defined in ovsdb-idl.c file, so "idl->table_by_name" will report warning. The function I want is to quarry tables in idl at the outside of ovsdb-idl.c. I don't know "ovsdb-idl.h" supply this function in API.
2015-03-06 9:01 GMT+08:00 yewgang <batmanu...@gmail.com>: > It does not work after adding #include "shash.h" in the .c file. It warns > again. > And if missing #include "shash.h", will the "struct shash_node *node;" > report warning ? > > 2015-03-06 0:51 GMT+08:00 Ben Pfaff <b...@nicira.com>: > >> Missing #include "shash.h" >> >> On Thu, Mar 05, 2015 at 09:23:43PM +0800, yewgang wrote: >> > Dear all, >> > >> > what's wrong with these codes ? I really don't know... >> > my codes is like this : >> > >> > static void >> > test_print_tables(struct ovsdb_idl *idl) >> > { >> > /* add for test */ >> > struct shash_node *node; >> > >> > SHASH_FOR_EACH(node, &idl->table_by_name) { // Report warning here >> > ...... >> > } >> > >> > } >> > >> > but the compiler report warning : >> > >> > vswitchd/inventory.c: In function 'test_print_tables': >> > vswitchd/inventory.c:219:5: error: dereferencing pointer to incomplete >> type >> > vswitchd/inventory.c:219:5: error: left-hand operand of comma expression >> > has no effect [-Werror=unused-value] >> > vswitchd/inventory.c:219:5: error: dereferencing pointer to incomplete >> type >> > vswitchd/inventory.c:219:5: error: left-hand operand of comma expression >> > has no effect [-Werror=unused-value] >> > cc1: all warnings being treated as errors >> > make[2]: *** [vswitchd/inventory.o] Error 1 >> > make[1]: *** [all-recursive] Error 1 >> > make: *** [all] Error 2 >> >> > _______________________________________________ >> > discuss mailing list >> > discuss@openvswitch.org >> > http://openvswitch.org/mailman/listinfo/discuss >> >> >
_______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss