Commit Graph

134 Commits

Author SHA1 Message Date
Evan Huus 2322bd3122 Fix lemon FSF address and add license exception for the generated mate grammar
files. One of them has no license (it is just defines) and the other gets picked
up as LGPL for no reason I can discern.

svn path=/trunk/; revision=52675
2013-10-18 18:10:46 +00:00
Chris Maynard 83b4b73dd1 Fix Coverity CID 280323 (Free of array-typed value) by ensuring that tpltname doesn't point to the buf[] stack array before attempting to free it.
#BACKPORT(1.10)

svn path=/trunk/; revision=50335
2013-07-03 01:47:18 +00:00
Gerald Combs 62d87b6cad tools/lemon/lemon.c: Fix an integer shortening issue. (CMake enables
-Werror here but Autotools doesn't. Which is correct?)

epan/dissectors/dcerpc: idl2wrs isn't an installed executable in
Autotools so don't make it one in CMake.

svn path=/trunk/; revision=49871
2013-06-10 18:55:03 +00:00
Anders Broman 3dc702e2a8 Align a bit more with upstream.
svn path=/trunk/; revision=48559
2013-03-26 05:36:27 +00:00
Anders Broman 41d6d12497 Rearrang the code to align with sqlite lemon and copy over a few more things.
svn path=/trunk/; revision=48014
2013-03-02 19:34:50 +00:00
Anders Broman bd2b6b9964 Wite space changes.
svn path=/trunk/; revision=48005
2013-03-02 12:09:50 +00:00
Anders Broman b9cb9968f2 lemon.c:3176:8: error: attempt to free a non-heap object ‘buf’
svn path=/trunk/; revision=48003
2013-03-02 11:32:25 +00:00
Anders Broman 310b495ff3 Becport more code.
svn path=/trunk/; revision=48002
2013-03-02 10:56:17 +00:00
Anders Broman ad1ec109ed Missed one place.
svn path=/trunk/; revision=48001
2013-03-02 10:03:43 +00:00
Anders Broman da070427d9 lemon.c:78:14: note: expected ‘int (*)(const void *, const void *)’ but argument is of type ‘int (*)(const char *, const char *)’
svn path=/trunk/; revision=48000
2013-03-02 09:54:52 +00:00
Anders Broman 99d88bd54b More backports from sqlite lemon to try to address warnings.
svn path=/trunk/; revision=47998
2013-03-02 09:04:52 +00:00
Anders Broman 7c3a122e37 lemon.c:4628:5: error: conflicting types for ‘Configcmp’
lemon.c:366:5: note: previous declaration of ‘Configcmp’ was here

svn path=/trunk/; revision=47997
2013-03-02 08:40:49 +00:00
Anders Broman 18c724b0ad More backports from sqlite lemon to try to address warnings.
svn path=/trunk/; revision=47996
2013-03-02 08:19:31 +00:00
Anders Broman a5c53e847e Backports from sqlite lemon.
svn path=/trunk/; revision=47993
2013-03-01 23:54:06 +00:00
Jeff Morriss 0b8d70bfb7 Fix a cut-n-pasteo and add a const cast to quiet a warning.
svn path=/trunk/; revision=47991
2013-03-01 22:58:23 +00:00
Anders Broman ea76d02cb2 Backport const casts from sqlite lemon.
svn path=/trunk/; revision=47989
2013-03-01 21:37:48 +00:00
Anders Broman 44993045a2 try to remove C++ incompatibilities from lemon
svn path=/trunk/; revision=47987
2013-03-01 20:32:20 +00:00
Guy Harris eb769ce13e Clean up some warnings (including warnings that ultimately come from
trying to modify string constants, which isn't necessarily guaranteed to
work).

svn path=/trunk/; revision=47618
2013-02-10 22:09:21 +00:00
Guy Harris fbe74322b1 From Bill Parker:
Add some additional memory-allocation failure checks in Lemon.

	Use NULL rather than 0 as the null-pointer constant in those
	checks.

From me:

	Catch one more of the NULL-vs-0 cases.

	Fix some failure messages to use fprintf(stderr, ...) -
	ErrorMsg() requires a file name and line number, and is
	generally used if you're going to continue rather than just give
	up.

svn path=/trunk/; revision=45214
2012-09-29 19:40:27 +00:00
Jeff Morriss 1a97b58332 Followup to r45034: Don't define _U_ on the compile line, pull it in from
config.h (like we do in cmake).  We always HAVE_CONFIG_H so don't check for it.

svn path=/trunk/; revision=45050
2012-09-21 21:29:18 +00:00
Jeff Morriss abc482e578 Revert r45018 and r45019: put config.h back in lemon.c and take _U_ back off
the compile line when building with cmake.

Put _U_'s definition in config.h when building with autofoo and on Windows.

svn path=/trunk/; revision=45034
2012-09-21 01:42:03 +00:00
Jeff Morriss 4501a9bc84 lemon is not compiled with HAVE_CONFIG_h so don't test for it nor try to include it.
svn path=/trunk/; revision=45018
2012-09-20 02:18:24 +00:00
Chris Maynard 5f6a3400dc Fix Coverity CID 709600: Resource leak.
svn path=/trunk/; revision=43694
2012-07-13 20:04:28 +00:00
Anders Broman 80aba5ebf7 From Martin Kaiser:
CID 280531: "Argument cannot be negative" in lemon
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7453

svn path=/trunk/; revision=43619
2012-07-09 02:24:07 +00:00
Jörg Mayer 2d7a4646e2 Include config.h in preparation of moving the definition
of _U_ from the compiler command line into config.h

svn path=/trunk/; revision=40806
2012-02-02 11:54:33 +00:00
Jörg Mayer 1ac8e97ff8 Fix an old style function declaration warning.
svn path=/trunk/; revision=37278
2011-05-19 04:42:57 +00:00
Ronnie Sahlberg f4d68c6a08 Memory leak in lemon.c
coverity 1177


svn path=/trunk/; revision=36427
2011-03-31 20:50:13 +00:00
Stig Bjørlykke feb0a4aeaa Allocate space for null termination in make_basename.
Coverity 710.

svn path=/trunk/; revision=36247
2011-03-22 11:46:19 +00:00
Ronnie Sahlberg dddec126f6 Coverity 323
Use strdup to copy a string literal we will free() later on.



svn path=/trunk/; revision=36240
2011-03-22 09:12:57 +00:00
Bill Meier b0aac9d9c2 WIN32 ==> _WIN32
svn path=/trunk/; revision=35745
2011-02-01 23:02:54 +00:00
Guy Harris 347e7a0052 More <stdarg.h> cleanup; some are real bugs, some are just "don't do
va_start and va_end unless you're actually going to use the va_list"
(those bring the va_start and va_end closer to the use point, which
makes it a little more obvious that we're using <stdarg.h> correctly and
makes it a little harder to use it incorrectly).

svn path=/trunk/; revision=32963
2010-05-26 02:25:13 +00:00
Stig Bjørlykke 17f62a4e1d Removed an unused assignment.
svn path=/trunk/; revision=30893
2009-11-09 14:25:29 +00:00
Stig Bjørlykke fd1a8138cb From Eric Sesterhenn via bug 4175:
Fixed fp leakage in error path.

svn path=/trunk/; revision=30757
2009-10-29 11:23:04 +00:00
Stig Bjørlykke 39c732d8bf Removed some redundant prototypes and some shadowed variables.
svn path=/trunk/; revision=30632
2009-10-20 09:31:07 +00:00
Stig Bjørlykke 618153d40f Remove resetting useCnt in errsym, as it seems to disable some error checking
we need to validate the filter syntax.

svn path=/trunk/; revision=28659
2009-06-08 10:03:41 +00:00
Gerald Combs e7a8150c7b Fix a bunch of Win64 compilation errors by cowardly casting size_ts to ints.
svn path=/trunk/; revision=25992
2008-08-12 21:25:19 +00:00
Anders Broman 27111e59f3 Update to sqlite lemon.c 1.60 and lempar.c 1.36
svn path=/trunk/; revision=25858
2008-07-29 12:40:03 +00:00
Anders Broman 25b308442d Update Lemon to v1.54 and lempar to v 1.31 from sqlite http://www.sqlite.org/cvstrac/dir?d=sqlite/tool
svn path=/trunk/; revision=24845
2008-04-08 09:54:19 +00:00
Anders Broman 593735b96e Update to sqlite lemon 1.51
svn path=/trunk/; revision=23629
2007-11-27 21:25:32 +00:00
Luis Ontanon 9a64c881a1 squelch signedness warnings generated by generated code due to mayors being decleared as signed but added as signed in tables (it will generate larger tables when the number of tokens or actions is more than MAX_INT8, MAX_INT16).
svn path=/trunk/; revision=21138
2007-03-23 00:15:48 +00:00
Ulf Lamping e28d403669 add type casts to fix two warnings
svn path=/trunk/; revision=21137
2007-03-22 23:50:38 +00:00
Luis Ontanon 822594e0ce do not use an uninitialized rp->line to generate destructor code for rules without code.
svn path=/trunk/; revision=20737
2007-02-07 16:08:19 +00:00
Luis Ontanon d1c6370f9b It looks that their fix to my fix broke things out...
svn path=/trunk/; revision=20452
2007-01-16 16:41:12 +00:00
Luis Ontanon 74ed71d648 update to lemon.c 1.43
svn path=/trunk/; revision=20447
2007-01-16 05:38:55 +00:00
Luis Ontanon 47730bc1e8 Fix a major leakage of token minors in lemon generated parsers due to the fact that lemon was not genmerating destructor code for elements in the RHS of rules without C-code.
svn path=/trunk/; revision=20442
2007-01-15 19:48:06 +00:00
Anders Broman a0b76c2fa2 Update to the latest versions from sqlite.
svn path=/trunk/; revision=19932
2006-11-19 16:24:18 +00:00
Jörg Mayer dd26a7021b nikai@nikai.net:
Remaining fixes from:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1225

svn path=/trunk/; revision=19895
2006-11-14 20:32:29 +00:00
Guy Harris ed351b85c1 Use "opt_func_string_t" so that we get some more type checking done.
Use safe_ versions of <ctype.h> macros, so we don't get hosed by
characters with the 8th bit set.

Define "tplt_linedir()" with a function prototype.

Constify some stuff to squelch compiler warnings.

svn path=/trunk/; revision=17694
2006-03-21 23:55:30 +00:00
Guy Harris 7a2997ff83 Make it a bit more like the SQLite lemon.c 1.36.
Get rid of some function pointer casting.

Get rid of an unused routine, and make some routines static.

Remove trailing white space.

svn path=/trunk/; revision=17693
2006-03-21 23:17:15 +00:00
Anders Broman 2d99b1a362 Mimmicing lemon.c 1.36 exactly for Symbolcmpp does not make MSVC completly happy, see what FC4 says.
svn path=/trunk/; revision=17692
2006-03-21 20:03:56 +00:00
Anders Broman b5f2bdac77 Upadates to squlite:s lemon 1.36
svn path=/trunk/; revision=17691
2006-03-21 18:56:34 +00:00
Anders Broman bc7e69cc09 Try again, this should take us to lemon version 1.16 http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c
svn path=/trunk/; revision=17683
2006-03-20 19:40:09 +00:00
Anders Broman 17cee445d7 Back out the previous changes (:
svn path=/trunk/; revision=17680
2006-03-20 08:16:03 +00:00
Anders Broman 4edc146c8d Insert the code from sqlite http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c:
2002-Mar-10 21:21    1.11    Check-in [425] : Bug fix: updates within a transaction would fail if there was existed a temporary table. By drh. (diff)  
2002-Mar-03 02:49    1.10    Check-in [411] : Bug fixes and additional tests for the subquery flattener. By drh. (diff)  

svn path=/trunk/; revision=17679
2006-03-20 06:41:08 +00:00
Anders Broman 5d20a3ba36 Sqlite lemon 1.8 ( 1.7 Make lemon 64-bit clean skipped) :
Bugfix Check-in [388] : Bug fix in lemon: 3-way conflicts (SHIFT/REDUCE/REDUCE) were not detected or resolved. This is now fixed. Also, table compression works a little better. By drh. (diff) 

http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c 


svn path=/trunk/; revision=17668
2006-03-19 13:59:44 +00:00
Anders Broman 94d4d822da Align lemon/lempar.c with Squlite ver 1.2 http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lempar.c
svn path=/trunk/; revision=17666
2006-03-19 08:54:00 +00:00
Anders Broman 4f48d73d90 Copy a bugfix from http://www.sqlite.org/cvstrac/tktview?tn=313
svn path=/trunk/; revision=17651
2006-03-16 22:18:15 +00:00
Luis Ontanon 943848cb02 Actually fix that leak!
svn path=/trunk/; revision=17540
2006-03-09 00:50:05 +00:00
Luis Ontanon cdc088fb66 An unimportant and harmless one per run leak in a tool used for building... Coverity cannot evaluate that :P
run 14 CID 107


svn path=/trunk/; revision=17526
2006-03-08 10:58:09 +00:00
Anders Broman 0331204009 Undo the prevous unfortunate "rearrangement of code".
svn path=/trunk/; revision=17508
2006-03-07 20:24:11 +00:00
Anders Broman 7e8a72a218 Fix a bug reported by covierty and solved by http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c
Rearrange the code a bit to make it easier to make a diff with the sqlite version of lemon.

svn path=/trunk/; revision=17502
2006-03-07 18:18:04 +00:00
Jörg Mayer 5e83d1e015 Fix more "no previous declaration" warnings
svn path=/trunk/; revision=15172
2005-08-02 04:35:40 +00:00
Anders Broman 40c841279f rom Maynard, Chris :
The attached patches, generated via  svn diff , correct various compiler 

& lint warnings, among them: 

 

lemon.c(2582) : warning C4090: '=' : different 'const' qualifiers


svn path=/trunk/; revision=15086
2005-07-26 09:52:50 +00:00
Jörg Mayer e1c6d9ac3d Fix some warnings (and one of my previous 'fixes')
svn path=/trunk/; revision=14997
2005-07-22 17:57:40 +00:00
Jörg Mayer f67b00ad9a More 'char*' -> 'const char*' warning fixes
svn path=/trunk/; revision=14986
2005-07-22 07:55:51 +00:00
Gerald Combs b94621701c From Steve Grubb:
Fix bounds checking in lemon.c.  Fix up an if/else block in
packet-dcerpc-samr.c.  Fix hex printing in packet-gtp.c.


Fix other problems discovered by Steve:

Fix a bounds check in packet-isis-lsp.c.  Also, fix netmask printing
on non-little-endian machines.  Add a comment about adding a netmask
routine to to_str.c.  Add bounds checks to packet-ncp2222.inc.


All of these apply to bug 217.

svn path=/trunk/; revision=14627
2005-06-14 18:18:05 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Jörg Mayer 61581fb780 Fix a warning by using a function typedef
svn path=/trunk/; revision=9834
2004-01-25 09:49:50 +00:00
Jörg Mayer 76c7e98449 Fix some of the warnings when compiling with -Wstrict-prototypes
svn path=/trunk/; revision=9720
2004-01-18 15:53:43 +00:00
Ulf Lamping d604209b21 removed some MSVC warnings (added type casts)
svn path=/trunk/; revision=9371
2003-12-21 00:16:54 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris c942bebb4c From Joerg Mayer: get rid of an unused argument, and flag another as
unused.

svn path=/trunk/; revision=5387
2002-05-04 10:16:12 +00:00
Guy Harris d4017a1ee1 Fix up some type/size problems that showed up when compiling on Digital
UNIX on Alpha.

svn path=/trunk/; revision=4635
2002-01-30 22:55:15 +00:00
Guy Harris cc21ec8124 Do __attribute__ stuff if the GCC version number is greater than or
equal to 2, not just if it's equal to 2 - GCC 3.0 makes it 3, not 2....

svn path=/trunk/; revision=3765
2001-07-22 10:25:50 +00:00
Guy Harris 032f16e2eb If length arguments to "%*s" aren't of type "int", cast them to "int",
as that's what C requires them to be.

svn path=/trunk/; revision=3610
2001-06-26 20:52:19 +00:00
Guy Harris a39e4e8a5d Signed vs. unsigned fixes from Joerg Mayer.
svn path=/trunk/; revision=3372
2001-04-23 23:45:35 +00:00
Gilbert Ramirez e79474408f Revert. MSVC is wrong. Thanks to Guy for pointing that out.
svn path=/trunk/; revision=3323
2001-04-18 04:52:51 +00:00
Gilbert Ramirez d61a474b93 Makefile.nmake pulls in settings from config.nmake
Move 'const' keyword to keep const qualifiers balanced... gets rid
of complaint from MSVC.

svn path=/trunk/; revision=3321
2001-04-18 03:02:57 +00:00
Guy Harris 64a43e1c0e Fixes to Lemon to get it to compile on platforms (such as some versions
of Tru64 UNIX) that define TRUE and FALSE.

Fixes to some Tru64 compiler warnings.

svn path=/trunk/; revision=3120
2001-03-09 04:35:25 +00:00
Guy Harris 7a47c7ef24 Don't cast the function argument to "qsort()" to the expected type, make
the function have the expected type.

Make the arguments to comparison functions used by the merge sort be
"const void *", not "void *", just as the arguments to the comparison
functions used by "qsort()" are "const void *".

svn path=/trunk/; revision=3040
2001-02-15 09:25:38 +00:00
Guy Harris 6eaa148b30 More paranoia - when compiling with GCC 2.x, do checks of the format
string argument and subsequent arguments to "ErrorMsg()".

Fix up the bugs the checks in question found.

svn path=/trunk/; revision=3038
2001-02-15 06:08:23 +00:00
Guy Harris efabd03215 Change "lemon" *NOT* to cast pointers to "int", as that doesn't work on
LP64 platforms.

Change "lemon" to use function prototypes and the official ANSI C style
of variable-argument-list functions, and to include various system
header files rather than to use non-prototype declaration of various
system functions, to do a lot more type checking.

svn path=/trunk/; revision=3037
2001-02-15 06:01:23 +00:00
Guy Harris d12fb1f952 Rename the "optarg()" and "opterr()" functions to "get_optarg()" and
"get_opterr()" so they don't collide with "getopt()"s "optarg" and
"opterr" globals (Solaris 2.6's <stdio.h> declares both "optarg" and
"opterr", causing "lemon.c" not to compile).

Define "safe_isXXX()" macros to call "isXXX()" after casting the
argument to "unsigned char" to handle characters with the 8th bit set.
Make some "int" variables used only to hold characters "char" instead.

svn path=/trunk/; revision=2970
2001-02-01 21:46:48 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00