aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2001-04-18 04:52:51 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2001-04-18 04:52:51 +0000
commit30824a5def3c0122cc2fc04a9666cee61dccca90 (patch)
tree9686eee5e88ecaa1d6fff98a61957f2b2f883885 /tools
parentf0876d6b22a0c06e3c77c6b8124cc717b089f2f6 (diff)
Revert. MSVC is wrong. Thanks to Guy for pointing that out.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3323 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rw-r--r--tools/lemon/lemon.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index 927154f291..d1a7c79e5b 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -25,7 +25,7 @@
** drh@acm.org
** http://www.hwaci.com/drh/
**
-** $Id: lemon.c,v 1.7 2001/04/18 03:02:57 gram Exp $
+** $Id: lemon.c,v 1.8 2001/04/18 04:52:51 gram Exp $
*/
#include <stdio.h>
#include <stdarg.h>
@@ -3528,8 +3528,18 @@ struct symbol *Symbol_new(char *x)
/* Compare two symbols */
int Symbolcmpp(const void *a_arg, const void *b_arg)
{
- const struct symbol **a = a_arg;
- const struct symbol **b = b_arg;
+/* MSVC complains about this, but it's wrong. GCC does not
+complain about this, as is right. From Guy Harris:
+
+At least as I read the ANSI C spec, GCC is right and MSVC is wrong here.
+The arguments are pointers to "const void", and should be cast to
+pointers to "const struct symbol *"; however, at least as I read the
+spec, "const struct symbol **" is "pointer to pointer to const struct
+symbol", not "pointer to const pointer to struct symbol".
+*/
+
+ struct symbol *const *a = a_arg;
+ struct symbol *const *b = b_arg;
return strcmp((**a).name,(**b).name);
}