wireshark/tools/lemon/patches/01-lempar-wireshark-warning...

50 lines
1.6 KiB
Diff
Raw Normal View History

lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
Make ParseInit and ParseFinalize static to fix -Wmissing-prototypes in
dtd_grammar.c. Hide ParseFallback to fix -Wunused-function since this feature
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
is not used by Wireshark.
Mark yymajor as _U_ since none of the lemon grammar files seem to use it in
their %syntax_error directive, this fixes -Wunused-parameter
SPDX-License-Identifier: CC0-1.0
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
--- a/lempar.c
+++ b/lempar.c
@@ -317,7 +317,7 @@ static int yyGrowStack(yyParser *p){
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
/* Initialize a new parser that has already been allocated.
*/
-void ParseInit(void *yypRawParser ParseCTX_PDECL){
+static void ParseInit(void *yypRawParser ParseCTX_PDECL){
yyParser *yypParser = (yyParser*)yypRawParser;
ParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH
@@ -424,7 +424,7 @@ static void yy_pop_parser_stack(yyParser *pParser){
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
/*
** Clear all secondary memory allocations from the parser
*/
-void ParseFinalize(void *p){
+static void ParseFinalize(void *p){
yyParser *pParser = (yyParser*)p;
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
@@ -831,7 +831,7 @@ static void yy_parse_failed(
*/
static void yy_syntax_error(
yyParser *yypParser, /* The parser */
- int yymajor, /* The major type of the error token */
+ int yymajor _U_, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */
){
ParseARG_FETCH
@@ -1059,6 +1059,7 @@ void Parse(
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
return;
}
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
+#if 0
/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
@@ -1072,3 +1073,4 @@ int ParseFallback(int iToken){
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
return 0;
#endif
lemon: sync with upstream (2018-09-08) Changes: - Drop the old basename modification that was present in the Wireshark version of lemon.c. Use a new option available since 2018-04-20 ("Add the -dDIRECTORY command-line option to LEMON.") - Redo the static analyzer warning fixes, identifying the root causes and adding assertions instead of hiding code with __clang_analyzer__. - Ignore compiler warnings instead of adding config.h, _U_, extra const keywords, unsigned/signed changes, etc. - Remove lemon.html, it is out-of-date and external links are available. In order to make future updates easier, document the exact steps that were followed to create the lemon.c and lempar.c files. Future changes SHOULD follow the same process. My process to reach this updated lemon version: 1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync with latest trunk.") which seems based on sqlite commit 2b3d584ffe. 2. Check successive Wireshark patches. Identified many non-functional changes to silence compiler warnings and static analyzer issues. Found one feature (basename) that can be replaced with upstream -d. 3. Write minimal patches and document changes. Upstream typos and coding style issues (other than trailing whitespace) were deliberately not fixed to remain as close as possible to upstream. Change-Id: I606f46dede86e34520f962a9e7163912392aad57 Reviewed-on: https://code.wireshark.org/review/30290 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 17:29:43 +00:00
}
+#endif