[GH-ISSUE #52] does not compile with -Werror -Wmissing-prototypes #169

Closed
opened 2026-03-13 16:43:14 +03:00 by kerem · 7 comments
Owner

Originally created by @RekGRpth on GitHub (Jul 22, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/52

fix

diff --git a/flex/lexer.lex b/flex/lexer.lex
index d8a8245..dafd9be 100644
--- a/flex/lexer.lex
+++ b/flex/lexer.lex
@@ -279,6 +279,6 @@ BREAK_LINE              (\r)?\n
 
 %%
 
-void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg) {
+static void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg) {
     printf("error: %s in line %d\n", msg, yylineno);
 }
\ No newline at end of file
Originally created by @RekGRpth on GitHub (Jul 22, 2021). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/52 fix ```diff diff --git a/flex/lexer.lex b/flex/lexer.lex index d8a8245..dafd9be 100644 --- a/flex/lexer.lex +++ b/flex/lexer.lex @@ -279,6 +279,6 @@ BREAK_LINE (\r)?\n %% -void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg) { +static void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg) { printf("error: %s in line %d\n", msg, yylineno); } \ No newline at end of file ```
kerem 2026-03-13 16:43:14 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@RekGRpth commented on GitHub (Jul 22, 2021):

fix does not work :(

<!-- gh-comment-id:884647730 --> @RekGRpth commented on GitHub (Jul 22, 2021): fix does not work :(
Author
Owner

@RekGRpth commented on GitHub (Jul 22, 2021):

worked fix

diff --git a/flex/lexer.lex b/flex/lexer.lex
index d8a8245..1083f38 100644
--- a/flex/lexer.lex
+++ b/flex/lexer.lex
@@ -10,6 +10,7 @@
     #include <ngx_core.h>
     #include <ngx_http_waf_module_parser.tab.h>
     #define VM_DEBUG
+    void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg);
     void yyerror (UT_array* array, const char* msg);
 %}
 
<!-- gh-comment-id:884649943 --> @RekGRpth commented on GitHub (Jul 22, 2021): worked fix ```diff diff --git a/flex/lexer.lex b/flex/lexer.lex index d8a8245..1083f38 100644 --- a/flex/lexer.lex +++ b/flex/lexer.lex @@ -10,6 +10,7 @@ #include <ngx_core.h> #include <ngx_http_waf_module_parser.tab.h> #define VM_DEBUG + void ngx_http_waf_error(UT_array* array, ngx_pool_t* pool, const char* msg); void yyerror (UT_array* array, const char* msg); %} ```
Author
Owner

@ADD-SP commented on GitHub (Jul 22, 2021):

Thanks for your help, it has been fixed in branch master, if it passes the test, please close the issue.

github.com/ADD-SP/ngx_waf@a850848303/flex/lexer.lex (L6-L14)

<!-- gh-comment-id:884735815 --> @ADD-SP commented on GitHub (Jul 22, 2021): Thanks for your help, it has been fixed in branch master, if it passes the test, please close the issue. https://github.com/ADD-SP/ngx_waf/blob/a850848303c1db198a4ce9fa241c9e3e7661d6cd/flex/lexer.lex#L6-L14
Author
Owner

@RekGRpth commented on GitHub (Jul 22, 2021):

yes it works! thanx

<!-- gh-comment-id:884765478 --> @RekGRpth commented on GitHub (Jul 22, 2021): yes it works! thanx
Author
Owner

@RekGRpth commented on GitHub (Jul 22, 2021):

could you fix compile with -Werror -Werror=unused-but-set-variable -Werror=unused-function please?

<!-- gh-comment-id:884768504 --> @RekGRpth commented on GitHub (Jul 22, 2021): could you fix compile with -Werror -Werror=unused-but-set-variable -Werror=unused-function please?
Author
Owner

@ADD-SP commented on GitHub (Jul 23, 2021):

could you fix compile with -Werror -Werror=unused-but-set-variable -Werror=unused-function please?

Done on branch dev.

<!-- gh-comment-id:885408977 --> @ADD-SP commented on GitHub (Jul 23, 2021): > > > could you fix compile with -Werror -Werror=unused-but-set-variable -Werror=unused-function please? Done on branch dev.
Author
Owner

@RekGRpth commented on GitHub (Jul 23, 2021):

thanx

<!-- gh-comment-id:885417743 --> @RekGRpth commented on GitHub (Jul 23, 2021): thanx
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#169
No description provided.