Re: [Wireshark-dev] Unix compiling errors
On Dec 1, 2015, at 7:25 AM, POZUELO Gloria (BCS/PSD)wrote: > I’d like to ask you, how could I fix this error, since I’m working on a > Windows environment and this error only appears by compiling for Unix. It's probably a compiler issue, not an OS issue; if you were using GCC on Windows, with the -Werror=c++-compat flag, you'd get the same warning, and if you were using a vendor C compiler (Oracle Studio, HP aCC, IBM XL C, etc.), you might not get that warning. > error: request for implicit conversion from ‘void *’ to ‘void **’ not > permitted in C++ [-Werror=c++-compat] > > while (!found && g_hash_table_iter_next(, (gpointer)_info, > (gpointer))) { Yes, as Evan noted, you need a "pointer to a pointer" (gpointer *) as the second and third arguments. > Looking at the Glib reference we can see that g_hash_table_iter_next needs 2 > gpointer parameters, but it seems to me that this is the cause of the error…. > gtp_info is a struct and f is a guint32*. gtp_info would have to be a *pointer* to a struct, so that _info would be a pointer to a pointer, and you'd cast it to "gpointer *" rather than to "gpointer". g_hash_table_iter_next() would set that pointer to point to the key of the next entry it finds in the hash table. I don't know what the values are in your hash table, guint32 or pointer to guint32, and the way you'd fix that one would depend on the type. ___ Sent via:Wireshark-dev mailing list Archives:https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe
Re: [Wireshark-dev] Unix compiling errors
On Tue, Dec 1, 2015 at 10:25 AM, POZUELO Gloria (BCS/PSD)wrote: > Hi all, > > > > I’d like to ask you, how could I fix this error, since I’m working on a > Windows environment and this error only appears by compiling for Unix. > > > > error: request for implicit conversion from ‘void *’ to ‘void **’ not > permitted in C++ [-Werror=c++-compat] > > while (!found && g_hash_table_iter_next(, (gpointer)_info, > (gpointer))) { > > ^ > > Looking at the Glib reference we can see that g_hash_table_iter_next needs 2 > gpointer parameters, but it seems to me that this is the cause of the > error…. gtp_info is a struct and f is a guint32*. It expects the second parameter to be a `gpointer *`, but you are only casting it to a gpointer - you should try `(gpointer *)` for the key parameter. > gboolean > > g_hash_table_iter_next (GHashTableIter *iter, > > gpointer *key, > > gpointer *value); > > > > And finally I have some doubts about this other error: > > error: cast to pointer from integer of different size > [-Werror=int-to-pointer-cast] > > g_slist_foreach(teid_list, (GFunc)teid_loop, > (gpointer)pinfo->fd->num); > > ^ > > This can be solve by using GINT_TO_POINTER function? It should be. > > Thank you very much in advance, > > > > Regards. > > > > > DISCLAIMER > http://www.bics.com/maildisclaimer/ > > ___ > Sent via:Wireshark-dev mailing list > Archives:https://www.wireshark.org/lists/wireshark-dev > Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev > mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe ___ Sent via:Wireshark-dev mailing list Archives:https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe