aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lemon
AgeCommit message (Collapse)AuthorFilesLines
2015-10-25Bail out immediately if we can't allocate a buffer for carving up $PATH.Guy Harris1-11/+10
Quit immediately, don't even bother allocating a buffer for the pathname of the file we found. Revert some other cosmetic changes, to reduce the differences between us and upstream. Change-Id: I217fecee64c7e6bac9272486d0cc334e192b501e Reviewed-on: https://code.wireshark.org/review/11253 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-25lemon: move free() to avoid mem leak (CID 718529)Dario Lombardo1-8/+11
Change-Id: I3b0740f5ccc3b9b87ed351e26f198152bbb1e599 Reviewed-on: https://code.wireshark.org/review/10801 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-24lemon: add free() to avoid mem leak (CID 1309088)Dario Lombardo1-1/+2
Change-Id: Id32864d324f72ffee9c1033f0f36a79eb2651334 Reviewed-on: https://code.wireshark.org/review/10797 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-16CMake: Add /WXGerald Combs1-2/+2
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off, similar to config.nmake. We haven't compiled C++ code with -Wshorten-64-to-32 for quite some time so there's no need to add -Wno-shorten-64-to-32 in ui/qt/CMakeLists.txt. Additionally, squelch ---- C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp) C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled with [ _RanIt=QList<QString>::iterator , _Pr=bool (__cdecl *)(const QString &,const QString &) ] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled with [ _RanIt=QList<QString>::iterator , _Pr=bool (__cdecl *)(const QString &,const QString &) ] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled with [ _Iter=QList<QString>::iterator , _RanIt=QList<QString>::iterator , _Diff=int , _Pr=bool (__cdecl *)(const QString &,const QString &) ] .\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled with [ _RanIt=QList<QString>::iterator , _Pr=bool (__cdecl *)(const QString &,const QString &) ] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp) C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp) C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp) ---- in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp so that we'll compile successfully. Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357 Reviewed-on: https://code.wireshark.org/review/10533 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-21lemonflex: fix warning: no previous prototype for 'df_scanner_*' ↵Alexis La Goutte1-4/+4
[-Wmissing-prototypes] lemonflex-tail.inc:44:1: warning: no previous prototype for 'df_scanner_text' [-Wmissing-prototypes] lemonflex-tail.inc:50:1: warning: no previous prototype for 'df_scanner_file' [-Wmissing-prototypes] lemonflex-tail.inc:59:1: warning: no previous prototype for 'df_scanner_cleanup' [-Wmissing-prototypes] Change-Id: If0476b430592df225234c5c685c8009ab08b5ab6 Reviewed-on: https://code.wireshark.org/review/10162 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-25lemon (tools): Fix Dead Store (Dead assignement/Dead increment) warning ↵Alexis La Goutte1-1/+0
found by Clang Change-Id: Ibfa0bfd589e77a58b7b242c7c2fe25ef052a874e Reviewed-on: https://code.wireshark.org/review/9516 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-07-02Try to fix OSX build bootAndersBroman1-4/+4
lemon.c:1784: warning: implicit conversion shortens 64-bit value into a 32-bit value lemon.c:1790: warning: implicit conversion shortens 64-bit value into a 32-bit value 1790: warning: implicit conversion shortens 64-bit value into a 32-bit value 1928: warning: implicit conversion shortens 64-bit value into a 32-bit value 2707: warning: implicit conversion shortens 64-bit value into a 32-bit value Change-Id: Ief1b64009891de6885c2c9a6cb0e290752de889f Reviewed-on: https://code.wireshark.org/review/9463 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-02Lemon: Update lemon toolsAlexis La Goutte2-647/+793
Update from SQLite trunk (19 April 2015) Add include <config.h> Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_) Fix implicit conversion loses integer precision Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] Fix function declaration isn’t a prototype [-Wstrict-prototypes] Fix warning: old-style function definition [-Wold-style-definition] Fix trailing whitespace Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake Fix -Wmissing-prototypes Remove unused function (acttab_free) Add basename the filename with only filename (no path...) Fix lemon.c:3435: warning: implicit conversion shortens 64-bit value into a 32-bit value Add "new" version of lempar.c (3 November 2009). LEMPAR: fix trailing whitespace LEMPAR: fix -Wunused-parameter Change-Id: I2df7e39c9a6846de26743a981fb76aca423fe813 Reviewed-on: https://code.wireshark.org/review/6502 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-11Revert "Lemon: Update lemon tools"Pascal Quantin1-722/+578
This reverts commit 5855dd8d538eb81d4825961b1bf0d583bf96f751. This Lemon update fails to compile on OSX and triggers asserts on other platforms Change-Id: I12a8a2bf32db31e5a9b0cb1a67a39724e30f3e91 Reviewed-on: https://code.wireshark.org/review/6496 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-11Lemon: Update lemon toolsAlexis La Goutte1-578/+722
Fix warning: declaration shadows a variable in the global scope [-Wshadow] Add include <config.h> Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_) Fix implicit conversion loses integer precision Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] Fix function declaration isn’t a prototype [-Wstrict-prototypes] Fix warning: old-style function definition [-Wold-style-definition] Fix trailing whitespace Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake Fix -Wmissing-prototypes Remove unused function (acttab_free) Add basename the filename with only filename (no path...) Change-Id: Ia79f61e29f828575df61cc89134c6c553044e86d Reviewed-on: https://code.wireshark.org/review/3976 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-02Add '*.nativecodeanalysis.xml' to 'clean' targetsBill Meier1-1/+1
Change-Id: I90dbf0b31fc737150a01533763a7869b34c68cb6 Reviewed-on: https://code.wireshark.org/review/6220 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-28Removed duplicated #include linesDario Lombardo1-1/+0
Change-Id: I9cafa3cd5c74121168777d8c656e7e94e89efd3c Reviewed-on: https://code.wireshark.org/review/6065 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-1/+0
(Using sed : sed -i '/^\*\* \$Id\$/,+1 d') (2 star and space) Change-Id: I48505ffb8bfa103cd7db0117e18cdb1925a7034d Reviewed-on: https://code.wireshark.org/review/884 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte3-3/+0
(Using sed :sed -i '/^\/\* \$Id\$ \*\//,+0 d') ( /* $Id */ ) Change-Id: I46e928d7f2a307c35876ed5d34cb6b7cccfcd6e9 Reviewed-on: https://code.wireshark.org/review/886 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte3-5/+0
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash) Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd Reviewed-on: https://code.wireshark.org/review/881 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-2/+1
(Using sed : sed -i '/^\* \$Id\$/,+1 d') (no space before star) Change-Id: I318968db2b8512ba1303b5fc5c624c66441658f0 Reviewed-on: https://code.wireshark.org/review/879 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^\$Id\$/,+1 d') (No space or star before $Id$) Change-Id: I0801bd7cf234d32487008a8b6dcee64875b07688 Reviewed-on: https://code.wireshark.org/review/876 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-01-19Fix two coverity messages:Jörg Mayer1-5/+3
*** CID 718534: Dereference before null check (REVERSE_INULL) /tools/lemon/lemon.c: 3425 in translate_code() 3419 rp->rhs[i]->index,i-rp->nrhs+1); 3420 }else{ 3421 /* No destructor defined for this term */ 3422 } 3423 } 3424 } >>> CID 718534: Dereference before null check (REVERSE_INULL) >>> Null-checking "rp->code" suggests that it may be null, but it has already been +dereferenced on all paths leading to the check. 3425 if( rp->code ){ 3426 cp = append_str(0,0,0,0); 3427 rp->code = Strsafe(cp?cp:""); 3428 } 3429 } 3430 *** CID 1156989: Out-of-bounds read (OVERRUN) /tools/lemon/lemon.c: 3139 in tplt_xfer() 3133 int i, iStart; 3134 char line[LINESIZE]; 3135 while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){ 3136 (*lineno)++; 3137 iStart = 0; 3138 if( name ){ >>> CID 1156989: Out-of-bounds read (OVERRUN) >>> Overrunning array "line" of 1000 bytes at byte offset 1000 using index "i" +(which evaluates to 1000). 3139 for(i=0; line[i] && i<LINESIZE; i++){ 3140 if( line[i]=='P' && i<(LINESIZE-5) && strncmp(&line[i],"Parse",5)==0 3141 && (i==0 || !safe_isalpha(line[i-1])) 3142 ){ 3143 if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]); 3144 fprintf(out,"%s",name); svn path=/trunk/; revision=54849
2014-01-13Squelch some warnings.Guy Harris1-2/+2
svn path=/trunk/; revision=54711
2013-11-28Fix potential signed int overflow in LemonBalint Reczey1-2/+2
This chrashed Solaris buildbot when -ftrapv was enabled. Triaged by Guy Harris, see detail at: http://www.wireshark.org/lists/wireshark-dev/201311/msg00185.html svn path=/trunk/; revision=53624
2013-10-27More SVN properties cleanup.Jeff Morriss1-1/+1
svn path=/trunk/; revision=52884
2013-10-18Fix lemon FSF address and add license exception for the generated mate grammarEvan Huus2-8/+6
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-13Add CMake properties to targets so that they are logically organised when ↵Graham Bloice1-0/+1
using a Visual Studio solution. Add CMake properties to group the source files in epan into logical blocks when using a Visual Studio solution. svn path=/trunk/; revision=52580
2013-07-03Fix Coverity CID 660 (Negative array index read) by holding off the ↵Chris Maynard1-18/+34
assignment to yytos until after we check that pParser->yyidx is non-negative. See also: http://cwe.mitre.org/data/definitions/129.html #BACKPORT(1.10) svn path=/trunk/; revision=50336
2013-07-03Fix Coverity CID 280323 (Free of array-typed value) by ensuring that ↵Chris Maynard1-6/+6
tpltname doesn't point to the buf[] stack array before attempting to free it. #BACKPORT(1.10) svn path=/trunk/; revision=50335
2013-06-25makefile.nmake -> Makefile.nmake and minor whitespace (spaces -> tabs) changes.Chris Maynard1-1/+1
svn path=/trunk/; revision=50140
2013-06-10tools/lemon/lemon.c: Fix an integer shortening issue. (CMake enablesGerald Combs1-1/+1
-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-05-20Make the minimum supported GLib version 2.16.Gerald Combs1-6/+0
svn path=/trunk/; revision=49444
2013-03-26Align a bit more with upstream.Anders Broman2-13/+17
svn path=/trunk/; revision=48559
2013-03-04Align lempar somewhat with upstream.Anders Broman1-24/+34
svn path=/trunk/; revision=48071
2013-03-02Rearrang the code to align with sqlite lemon and copy over a few more things.Anders Broman1-174/+179
svn path=/trunk/; revision=48014
2013-03-02Wite space changes.Anders Broman1-50/+50
svn path=/trunk/; revision=48005
2013-03-02lemon.c:3176:8: error: attempt to free a non-heap object ‘buf’Anders Broman1-1/+0
svn path=/trunk/; revision=48003
2013-03-02Becport more code.Anders Broman1-10/+9
svn path=/trunk/; revision=48002
2013-03-02Missed one place.Anders Broman1-1/+2
svn path=/trunk/; revision=48001
2013-03-02lemon.c:78:14: note: expected ‘int (*)(const void *, const void *)’ but ↵Anders Broman1-1/+1
argument is of type ‘int (*)(const char *, const char *)’ svn path=/trunk/; revision=48000
2013-03-02More backports from sqlite lemon to try to address warnings.Anders Broman1-14/+20
svn path=/trunk/; revision=47998
2013-03-02lemon.c:4628:5: error: conflicting types for ‘Configcmp’Anders Broman1-1/+1
lemon.c:366:5: note: previous declaration of ‘Configcmp’ was here svn path=/trunk/; revision=47997
2013-03-02More backports from sqlite lemon to try to address warnings.Anders Broman1-15/+15
svn path=/trunk/; revision=47996
2013-03-01Backports from sqlite lemon.Anders Broman1-8/+11
svn path=/trunk/; revision=47993
2013-03-01Fix a cut-n-pasteo and add a const cast to quiet a warning.Jeff Morriss1-2/+2
svn path=/trunk/; revision=47991
2013-03-01Backport const casts from sqlite lemon.Anders Broman1-26/+30
svn path=/trunk/; revision=47989
2013-03-01try to remove C++ incompatibilities from lemonAnders Broman1-89/+95
svn path=/trunk/; revision=47987
2013-02-10Clean up some warnings (including warnings that ultimately come fromGuy Harris1-60/+56
trying to modify string constants, which isn't necessarily guaranteed to work). svn path=/trunk/; revision=47618
2012-09-29From Bill Parker:Guy Harris1-13/+25
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-21Followup to r45034: Don't define _U_ on the compile line, pull it in fromJeff Morriss3-8/+7
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-21Revert r45018 and r45019: put config.h back in lemon.c and take _U_ back offJeff Morriss2-6/+3
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-20Fix lemon build with cmake by defining _U_. I feel like there's a betterEvan Huus1-0/+6
way than all the horrid escaping I had to do, but I don't know what it is. svn path=/trunk/; revision=45019
2012-09-20lemon is not compiled with HAVE_CONFIG_h so don't test for it nor try to ↵Jeff Morriss1-7/+4
include it. svn path=/trunk/; revision=45018
2012-07-13Fix Coverity CID 709600: Resource leak.Chris Maynard1-0/+1
svn path=/trunk/; revision=43694