[Privoxy-commits] [privoxy] 01/04: action_render_string_filters_template(): Declare a variable at the beginning

User Git git at git.privoxy.org
Sun Dec 20 10:00:14 UTC 2020


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit f406a05446ac644829d7791b2bc829af8293e651
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sat Dec 19 16:59:48 2020 +0100

    action_render_string_filters_template(): Declare a variable at the beginning
    
    ... of the function to silence a compiler warning when building with -std=c89:
    
       cc -c -pipe -fstack-protector-all -ggdb -Wshadow  -Wconversion -I/usr/local/include/  -pthread -Wall -std=c89   cgiedit.c -o cgiedit.o
       cgiedit.c:4436:9: warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat]
          for (int i=0; i < SZ(desc); ++i)
               ^
       1 warning generated.
---
 cgiedit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cgiedit.c b/cgiedit.c
index af22d071..e979ebc3 100644
--- a/cgiedit.c
+++ b/cgiedit.c
@@ -4421,6 +4421,7 @@ static jb_err action_render_string_filters_template(struct map * exports,
 {
    jb_err err = JB_ERR_OK;
    int filter_identifier = 0;
+   int i;
    char *prepared_template = strdup("");
 
    struct action_multi {
@@ -4433,7 +4434,7 @@ static jb_err action_render_string_filters_template(struct map * exports,
        { 'n', action->multi_remove[type->multi_action_index][0].first }
    };
 
-   for (int i=0; i < SZ(desc); ++i)
+   for (i = 0; i < SZ(desc); ++i)
    {
       const char radio = desc[i].radio;
       struct list_entry *entry = desc[i].list;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list