From f82f18a186e3284846a0c326065b23dba8831288 Mon Sep 17 00:00:00 2001 From: wmeier Date: Wed, 10 Aug 2011 04:42:42 +0000 Subject: [PATCH] Update a comment about hack used to prevent gcc "unused_result" warning for strtoul() call. Specifically: The following hack prevents a gcc "unused_result" warning and is not flagged (currently) by either Coverity or CLang. if (strtoul(...){} git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38441 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/prefs_dlg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index 6dae47ff54..01eabe7bc9 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -910,10 +910,10 @@ pref_check(pref_t *pref, gpointer user_data) /* XXX: The following ugly hack prevents a gcc warning "ignoring return value of 'strtoul', declared with attribute warn_unused_result" - which can occur when using certain gcc configurations (see _FORTIFY_SOURCE). + which can occur when using certain gcc configurations (see -D_FORTIFY_SOURCE). A dummy variable is not used because when using gcc 4.6 with -Wextra a "set but not used [-Wunused-but-set-variable]" warning will occur. - TBD: will this hack pass muster with other validators such as Coverity, CLang, & etc + (Coverity & CLang apparently do not object to this hack). [Guy Harris comment: "... perhaps either using spin buttons for numeric preferences, or otherwise making -- 2.34.1