#5399 closed defect (fixed)

address_standardizer compile time warnings

Reported by: strk Owned by: robe
Priority: medium Milestone: PostGIS 3.4.0
Component: pagc_address_parser Version: master
Keywords: Cc:

Description

I get many:

../.././../../extensions/address_standardizer/address_standardizer.c:207:7: warning: unused variable 'ruleref' [-Wunused-variable]
                KW *ruleref = __cur_stz__->build_key;
                    ^
../.././../../extensions/address_standardizer/address_standardizer.c:68:26: warning: unused variable 'values' [-Wunused-variable]
    char               **values;
                         ^
2 warnings generated.
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -std=gnu99 -O2 -g -Wall -fno-math-errno -fno-signed-zeros -Wall -flto  -I/usr/local/include -I/opt/proj-9.1/include -I/usr/include/x86_64-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG  -DPCRE_VERSION=2 -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o address_standardizer.o ../.././../../extensions/address_standardizer/address_standardizer.c
../.././../../extensions/address_standardizer/address_standardizer.c: In function ‘debug_standardize_address’:
../.././../../extensions/address_standardizer/address_standardizer.c:94:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   94 |                 int                  err;
      |                 ^~~
../.././../../extensions/address_standardizer/address_standardizer.c:151:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  151 |     if (!std)
      |     ^~
../.././../../extensions/address_standardizer/address_standardizer.c:155:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  155 |         STAND_PARAM *ms = std->misc_stand;
      |         ^~~~~~~~~~~
../.././../../extensions/address_standardizer/address_standardizer.c:155:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
../.././../../extensions/address_standardizer/address_standardizer.c:160:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  160 |         DEF *__def__ ;
      |         ^~~
../.././../../extensions/address_standardizer/address_standardizer.c:168:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  168 |         int started = 0;
      |         ^~~
../.././../../extensions/address_standardizer/address_standardizer.c:205:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  205 |                 STZ *__cur_stz__ = __stz_list__[stz_no] ;
      |                 ^~~
../.././../../extensions/address_standardizer/address_standardizer.c:207:21: warning: unused variable ‘ruleref’ [-Wunused-variable]
  207 |                 KW *ruleref = __cur_stz__->build_key;
      |                     ^~~~~~~
../.././../../extensions/address_standardizer/address_standardizer.c:68:26: warning: unused variable ‘values’ [-Wunused-variable]
   68 |     char               **values;
      |                          ^~~~~~

Change History (4)

comment:1 by strk, 18 months ago

the compiler switches:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -std=gnu99 -O2 -g -Wall -fno-math-errno -fno-signed-zeros -Wall -flto  -I/usr/local/include -I/opt/proj-9.1/include -I/usr/include/x86_64-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG  -DPCRE_VERSION=2 -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o address_standardizer.o ../.././../../extensions/address_standardizer/address_standardizer.c

GCC version: gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

comment:2 by robe, 17 months ago

Component: postgispagc_address_parser
Owner: changed from pramsey to robe

comment:3 by robe, 17 months ago

@strk are you still seeing this error. I thought I got rid of these when I saw several of the other bots complaining about this. That line 207 for example no longer exists.

comment:4 by robe, 17 months ago

Resolution: fixed
Status: newclosed

Going to assume since all bots are green this is not an issue anymore.

Note: See TracTickets for help on using tickets.