Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several compiler warnings during build (make check) #1223

Closed
diederikdehaas opened this issue Apr 4, 2023 · 2 comments · Fixed by #1244
Closed

Several compiler warnings during build (make check) #1223

diederikdehaas opened this issue Apr 4, 2023 · 2 comments · Fixed by #1244

Comments

@diederikdehaas
Copy link
Contributor

Describe the bug
When running make check VERBOSE=1 (on amd64), I'm seeing several compiler warnings of the following categories:

  • incompatible-pointer-types
  • format-truncation=
  • stringop-truncation

To Reproduce

  1. clone repo; cd repo-dir; ./bootstrap; ./configure
  2. Run make check VERBOSE=1
  3. See compiler issue several warnings (See output below)

Expected behavior
A build output without compiler warnings.

Screenshots

diederik@bagend:~/dev/github/rrdtool-1.x$ make check VERBOSE=1
Making check in po
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/po'
make rrdtool.pot-update
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/po'
sed -e '/^#/d' remove-potcdate.sin > t-remove-potcdate.sed
mv t-remove-potcdate.sed remove-potcdate.sed
if LC_ALL=C grep 'GNU rrdtool' ../* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
  package_gnu='GNU '; \
else \
  package_gnu=''; \
fi; \
if test -n 'https://github.com/oetiker/rrdtool-1.x/issues' || test '' = '@'PACKAGE_BUGREPORT'@'; then \
  msgid_bugs_address='https://github.com/oetiker/rrdtool-1.x/issues'; \
else \
  msgid_bugs_address=''; \
fi; \
case `/usr/bin/xgettext --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
    /usr/bin/xgettext --default-domain=rrdtool --directory=.. \
      --add-comments=TRANSLATORS: --keyword=_ --keyword=N_  \
      --files-from=./POTFILES.in \
      --copyright-holder='Tobias Oetiker' \
      --msgid-bugs-address="$msgid_bugs_address" \
    ;; \
  *) \
    /usr/bin/xgettext --default-domain=rrdtool --directory=.. \
      --add-comments=TRANSLATORS: --keyword=_ --keyword=N_  \
      --files-from=./POTFILES.in \
      --copyright-holder='Tobias Oetiker' \
      --package-name="${package_gnu}rrdtool" \
      --package-version='1.8.0' \
      --msgid-bugs-address="$msgid_bugs_address" \
    ;; \
esac
test ! -f rrdtool.po || { \
  if test -f ./rrdtool.pot; then \
    sed -f remove-potcdate.sed < ./rrdtool.pot > rrdtool.1po && \
    sed -f remove-potcdate.sed < rrdtool.po > rrdtool.2po && \
    if cmp rrdtool.1po rrdtool.2po >/dev/null 2>&1; then \
      rm -f rrdtool.1po rrdtool.2po rrdtool.po; \
    else \
      rm -f rrdtool.1po rrdtool.2po ./rrdtool.pot && \
      mv rrdtool.po ./rrdtool.pot; \
    fi; \
  else \
    mv rrdtool.po ./rrdtool.pot; \
  fi; \
}
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/po'
test ! -f ./rrdtool.pot || \
  test -z "fr.gmo hu.gmo" || make fr.gmo hu.gmo
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/po'
/usr/bin/msgmerge --update fr.po rrdtool.pot
................... done.
rm -f fr.gmo && /usr/bin/msgfmt -c --statistics -o fr.gmo fr.po
29 translated messages, 3 fuzzy translations.
/usr/bin/msgmerge --update hu.po rrdtool.pot
..................... done.
rm -f hu.gmo && /usr/bin/msgfmt -c --statistics -o hu.gmo hu.po
27 translated messages, 5 fuzzy translations.
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/po'
touch stamp-po
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/po'
Making check in src
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/src'
  CC       rrd_tool.o
  CC       librrd_la-rrd_version.lo
  CC       librrd_la-rrd_last.lo
  CC       librrd_la-rrd_lastupdate.lo
  CC       librrd_la-rrd_first.lo
  CC       librrd_la-rrd_dump.lo
  CC       librrd_la-rrd_flushcached.lo
  CC       librrd_la-rrd_fetch.lo
  CC       librrd_la-rrd_fetch_cb.lo
  CC       librrd_la-rrd_resize.lo
  CC       librrd_la-rrd_tune.lo
rrd_tune.c: In function 'rrd_tune_r':
rrd_tune.c:239:35: warning: passing argument 3 of 'optparse_init' from incompatible pointer type [-Wincompatible-pointer-types]
  239 |     optparse_init(&options, argc, argv); /* re-initialize optparse */
      |                                   ^~~~
      |                                   |
      |                                   const char **
In file included from rrd_tool.h:49,
                 from rrd_tune.c:46:
optparse.h:68:63: note: expected 'char **' but argument is of type 'const char **'
   68 | void optparse_init(struct optparse *options, int argc, char **argv);
      |                                                        ~~~~~~~^~~~
  CC       librrd_la-rrd_list.lo
rrd_list.c: In function 'rrd_list_rec':
rrd_list.c:76:53: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 1 and 4095 [-Wformat-truncation=]
   76 |                 snprintf(&current[0], PATH_MAX, "%s/%s", dirname, entry->d_name);
      |                                                     ^~
rrd_list.c:76:17: note: 'snprintf' output between 2 and 4351 bytes into a destination of size 4096
   76 |                 snprintf(&current[0], PATH_MAX, "%s/%s", dirname, entry->d_name);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       librrd_la-rrd_graph.lo
  CC       librrd_la-rrd_graph_helper.lo
  CC       librrd_la-rrd_xport.lo
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:754:55: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 242 [-Wformat-truncation=]
  754 |             snprintf(buf, sizeof(buf), "    \"%s\": \"%s\",\n",
      |                                                       ^~
  755 |                      META_START_TAG, dbuf);
      |                                      ~~~~              
rrd_xport.c:754:13: note: 'snprintf' output between 18 and 1041 bytes into a destination of size 256
  754 |             snprintf(buf, sizeof(buf), "    \"%s\": \"%s\",\n",
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  755 |                      META_START_TAG, dbuf);
      |                      ~~~~~~~~~~~~~~~~~~~~~
rrd_xport.c:779:55: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 244 [-Wformat-truncation=]
  779 |             snprintf(buf, sizeof(buf), "    \"%s\": \"%s\",\n", META_END_TAG,
      |                                                       ^~
  780 |                      dbuf);
      |                      ~~~~                              
rrd_xport.c:779:13: note: 'snprintf' output between 16 and 1039 bytes into a destination of size 256
  779 |             snprintf(buf, sizeof(buf), "    \"%s\": \"%s\",\n", META_END_TAG,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  780 |                      dbuf);
      |                      ~~~~~
rrd_xport.c:757:49: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 245 [-Wformat-truncation=]
  757 |             snprintf(buf, sizeof(buf), "    <%s>%s</%s>\n", META_START_TAG,
      |                                                 ^~
  758 |                      dbuf, META_START_TAG);
      |                      ~~~~                        
rrd_xport.c:757:13: note: 'snprintf' output between 21 and 1044 bytes into a destination of size 256
  757 |             snprintf(buf, sizeof(buf), "    <%s>%s</%s>\n", META_START_TAG,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758 |                      dbuf, META_START_TAG);
      |                      ~~~~~~~~~~~~~~~~~~~~~
rrd_xport.c:782:49: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 247 [-Wformat-truncation=]
  782 |             snprintf(buf, sizeof(buf), "    <%s>%s</%s>\n", META_END_TAG,
      |                                                 ^~
  783 |                      dbuf, META_END_TAG);
      |                      ~~~~                        
rrd_xport.c:782:13: note: 'snprintf' output between 17 and 1040 bytes into a destination of size 256
  782 |             snprintf(buf, sizeof(buf), "    <%s>%s</%s>\n", META_END_TAG,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  783 |                      dbuf, META_END_TAG);
      |                      ~~~~~~~~~~~~~~~~~~~
rrd_xport.c:832:49: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 249 [-Wformat-truncation=]
  832 |             snprintf(buf, sizeof(buf), "      \"%s\"", dbuf);
      |                                                 ^~     ~~~~
rrd_xport.c:832:13: note: 'snprintf' output between 9 and 1032 bytes into a destination of size 256
  832 |             snprintf(buf, sizeof(buf), "      \"%s\"", dbuf);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rrd_xport.c:1179:70: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 235 [-Wformat-truncation=]
 1179 |                 snprintf(buf, sizeof(buf), ",\n        { \"line\": \"%s\" }",
      |                                                                      ^~
 1180 |                          dbuf);
      |                          ~~~~                                         
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1179:17: note: 'snprintf' output between 25 and 1048 bytes into a destination of size 256
 1179 |                 snprintf(buf, sizeof(buf), ",\n        { \"line\": \"%s\" }",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1180 |                          dbuf);
      |                          ~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1260:60: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 241 [-Wformat-truncation=]
 1260 |                 snprintf(buf, sizeof(buf), "        <vrule>%s</vrule>\n",
      |                                                            ^~
 1261 |                          dbuf);
      |                          ~~~~                               
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1260:17: note: 'snprintf' output between 25 and 1048 bytes into a destination of size 256
 1260 |                 snprintf(buf, sizeof(buf), "        <vrule>%s</vrule>\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1261 |                          dbuf);
      |                          ~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1257:71: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 234 [-Wformat-truncation=]
 1257 |                 snprintf(buf, sizeof(buf), ",\n        { \"vrule\": \"%s\" }",
      |                                                                       ^~
 1258 |                          dbuf);
      |                          ~~~~                                          
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1257:17: note: 'snprintf' output between 26 and 1049 bytes into a destination of size 256
 1257 |                 snprintf(buf, sizeof(buf), ",\n        { \"vrule\": \"%s\" }",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1258 |                          dbuf);
      |                          ~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1240:60: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 241 [-Wformat-truncation=]
 1240 |                 snprintf(buf, sizeof(buf), "        <hrule>%s</hrule>\n",
      |                                                            ^~
 1241 |                          dbuf);
      |                          ~~~~                               
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1240:17: note: 'snprintf' output between 25 and 1048 bytes into a destination of size 256
 1240 |                 snprintf(buf, sizeof(buf), "        <hrule>%s</hrule>\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1241 |                          dbuf);
      |                          ~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1237:71: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 234 [-Wformat-truncation=]
 1237 |                 snprintf(buf, sizeof(buf), ",\n        { \"hrule\": \"%s\" }",
      |                                                                       ^~
 1238 |                          dbuf);
      |                          ~~~~                                          
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1237:17: note: 'snprintf' output between 26 and 1049 bytes into a destination of size 256
 1237 |                 snprintf(buf, sizeof(buf), ",\n        { \"hrule\": \"%s\" }",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1238 |                          dbuf);
      |                          ~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1162:55: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 232 [-Wformat-truncation=]
 1162 |                          ",\n        { \"comment\": \"%s\" }", dbuf);
      |                                                       ^~       ~~~~
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1161:17: note: 'snprintf' output between 28 and 1051 bytes into a destination of size 256
 1161 |                 snprintf(buf, sizeof(buf),
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
 1162 |                          ",\n        { \"comment\": \"%s\" }", dbuf);
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1151:57: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size between 240 and 241 [-Wformat-truncation=]
 1151 |                 snprintf(buf, sizeof(buf), "        <%s>%s</%s>\n", usetag,
      |                                                         ^~
 1152 |                          dbuf, usetag);
      |                          ~~~~                            
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1151:17: note: 'snprintf' output between 25 and 1050 bytes into a destination of size 256
 1151 |                 snprintf(buf, sizeof(buf), "        <%s>%s</%s>\n", usetag,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1152 |                          dbuf, usetag);
      |                          ~~~~~~~~~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:1148:68: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size between 233 and 234 [-Wformat-truncation=]
 1148 |                 snprintf(buf, sizeof(buf), ",\n        { \"%s\": \"%s\" }",
      |                                                                    ^~
 1149 |                          usetag, dbuf);
      |                                  ~~~~                               
In function 'rrd_xport_format_addprints',
    inlined from 'rrd_xport_format_xmljson' at rrd_xport.c:853:9:
rrd_xport.c:1148:17: note: 'snprintf' output between 26 and 1050 bytes into a destination of size 256
 1148 |                 snprintf(buf, sizeof(buf), ",\n        { \"%s\": \"%s\" }",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1149 |                          usetag, dbuf);
      |                          ~~~~~~~~~~~~~
rrd_xport.c: In function 'rrd_xport_format_xmljson':
rrd_xport.c:901:39: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 244 [-Wformat-truncation=]
  901 |                          "    <%s><%s>%s</%s>", DATA_ROW_TAG, COL_TIME_TAG,
      |                                       ^~
  902 |                          dbuf, COL_TIME_TAG);
      |                          ~~~~          
rrd_xport.c:900:17: note: 'snprintf' output between 17 and 1040 bytes into a destination of size 256
  900 |                 snprintf(buf, sizeof(buf),
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
  901 |                          "    <%s><%s>%s</%s>", DATA_ROW_TAG, COL_TIME_TAG,
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  902 |                          dbuf, COL_TIME_TAG);
      |                          ~~~~~~~~~~~~~~~~~~~
  CC       librrd_la-rrd_gfx.lo
  CC       librrd_la-pngsize.lo
  CC       librrd_la-rrd_restore.lo
  CC       librrdupd_la-mutex.lo
  CC       librrdupd_la-optparse.lo
  CC       librrdupd_la-rrd_strtod.lo
  CC       librrdupd_la-rrd_create.lo
  CC       librrdupd_la-hash_32.lo
  CC       librrdupd_la-rrd_parsetime.lo
  CC       librrdupd_la-rrd_hw.lo
  CC       librrdupd_la-rrd_hw_math.lo
  CC       librrdupd_la-rrd_hw_update.lo
  CC       librrdupd_la-rrd_diff.lo
  CC       librrdupd_la-rrd_format.lo
  CC       librrdupd_la-rrd_info.lo
  CC       librrdupd_la-rrd_error.lo
  CC       librrdupd_la-rrd_open.lo
  CC       librrdupd_la-rrd_client.lo
  CC       librrdupd_la-rrd_nan_inf.lo
  CC       librrdupd_la-rrd_rpncalc.lo
rrd_rpncalc.c: In function 'addop2str.part.0':
rrd_rpncalc.c:246:9: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  246 |         strncpy(&((*result_str)[*offset]), op_str, op_len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rrd_rpncalc.c:238:18: note: length computed here
  238 |         op_len = strlen(op_str);
      |                  ^~~~~~~~~~~~~~
  CC       librrdupd_la-rrd_utils.lo
  CC       librrdupd_la-rrd_snprintf.lo
  CC       librrdupd_la-rrd_update.lo
  CC       librrdupd_la-rrd_modify.lo
  CC       librrdupd_la-quicksort.lo
  CC       librrdupd_la-rrd_thread_safe.lo
  CCLD     librrdupd.la
  CCLD     librrd.la
  CCLD     rrdtool
  CC       rrdupdate.o
  CCLD     rrdupdate
  CC       rrd_cgi.o
  CCLD     rrdcgi
  CC       rrdcached-rrd_daemon.o
rrd_daemon.c: In function ‘handle_request_list’:
rrd_daemon.c:2651:50: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
 2651 |             snprintf(&absolute[0], PATH_MAX, "%s/%s", fullpath, current);
      |                                                  ^~             ~~~~~~~
rrd_daemon.c:2651:13: note: ‘snprintf’ output between 2 and 8192 bytes into a destination of size 4096
 2651 |             snprintf(&absolute[0], PATH_MAX, "%s/%s", fullpath, current);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CCLD     rrdcached
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/src'
Making check in bindings
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
mkdir -p ./perl-piped
( cd ./perl-piped \
  && ( test -e Makefile.PL || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped/Makefile.PL ) \
  && ( test -e RRDp.pm || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped/RRDp.pm ) \
  && ( test -e t || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped/t ) \
          && env \
             ABS_TOP_SRCDIR=/home/diederik/dev/github/rrdtool-1.x \
             ABS_TOP_BUILDDIR=/home/diederik/dev/github/rrdtool-1.x \
             ABS_SRCDIR=/home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped \
             /usr/bin/perl Makefile.PL PREFIX=/opt/rrdtool-1.8.0 INSTALL_BASE= LIB=/opt/rrdtool-1.8.0/lib/perl/5.36.0 INSTALLSITEMAN3DIR=/opt/rrdtool-1.8.0/share/man/man3 \
          && make )
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for RRDp
Writing MYMETA.yml and MYMETA.json
make[3]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped'
cp RRDp.pm blib/lib/RRDp.pm
Manifying 1 pod document
make[3]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings/perl-piped'
mkdir -p ./perl-shared
( cd ./perl-shared \
  && ( test -e Makefile.PL || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared/Makefile.PL ) \
  && ( test -e RRDs.pm || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared/RRDs.pm ) \
  && ( test -e RRDs.ppd || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared/RRDs.ppd ) \
  && ( test -e RRDs.xs || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared/RRDs.xs ) \
  && ( test -e t || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared/t ) \
          && env \
             ABS_TOP_SRCDIR=/home/diederik/dev/github/rrdtool-1.x \
             ABS_TOP_BUILDDIR=/home/diederik/dev/github/rrdtool-1.x \
             ABS_SRCDIR=/home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared \
             /usr/bin/perl Makefile.PL  PREFIX=/opt/rrdtool-1.8.0 INSTALL_BASE= LIB=/opt/rrdtool-1.8.0/lib/perl/5.36.0 INSTALLSITEMAN3DIR=/opt/rrdtool-1.8.0/share/man/man3 RPATH=/opt/rrdtool-1.8.0/lib \
          && make )
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for RRDs
Writing MYMETA.yml and MYMETA.json
make[3]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared'
cp RRDs.pm blib/lib/RRDs.pm
Running Mkbootstrap for RRDs ()
chmod 644 "RRDs.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- RRDs.bs blib/arch/auto/RRDs/RRDs.bs 644
"/usr/bin/perl" "/usr/share/perl/5.36/ExtUtils/xsubpp"  -typemap '/usr/share/perl/5.36/ExtUtils/typemap'  RRDs.xs > RRDs.xsc
mv RRDs.xsc RRDs.c
x86_64-linux-gnu-gcc -c  -I/home/diederik/dev/github/rrdtool-1.x/src -I/home/diederik/dev/github/rrdtool-1.x/src -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.8\" -DXS_VERSION=\"1.8\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.36/CORE"  -DPERLPATCHLEVEL=36 RRDs.c
rm -f blib/arch/auto/RRDs/RRDs.so
x86_64-linux-gnu-gcc  -shared -L/usr/local/lib -fstack-protector-strong  RRDs.o -L/home/diederik/dev/github/rrdtool-1.x/src/.libs/ -Wl,--rpath -Wl,/opt/rrdtool-1.8.0/lib -lrrd  -o blib/arch/auto/RRDs/RRDs.so  \
      \
  
chmod 755 blib/arch/auto/RRDs/RRDs.so
Manifying 1 pod document
make[3]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings/perl-shared'
mkdir -p ./perl-shared
mkdir -p ./ruby
( cd ./ruby \
          && /usr/bin/ruby /home/diederik/dev/github/rrdtool-1.x/bindings/ruby/extconf.rb \
          && make \
             EPREFIX=/opt/rrdtool-1.8.0 \
             ABS_TOP_SRCDIR=/home/diederik/dev/github/rrdtool-1.x \
             ABS_TOP_BUILDDIR=/home/diederik/dev/github/rrdtool-1.x \
             sitedir=/opt/rrdtool-1.8.0/lib/ruby RUBYARCHDIR= )
checking for rrd_create() in -lrrd... no
creating Makefile
make[3]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/bindings/ruby'
compiling main.c
linking shared-object RRD.so
make[3]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings/ruby'
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
Making check in tests
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/tests'
make  compat-cloexec
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/tests'
  CC       test_compat-cloexec.o
  CC       compat-cloexec.o
  CCLD     compat-cloexec
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/tests'
make  check-TESTS
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/tests'
make[3]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/tests'
PASS: modify1
PASS: modify2
PASS: modify3
PASS: modify4
PASS: modify5
PASS: tune1
PASS: tune2
PASS: graph1
PASS: graph2
PASS: rpn1
PASS: rpn2
PASS: rrdcreate
PASS: compat-cloexec
PASS: dump-restore
PASS: create-with-source-1
PASS: create-with-source-2
PASS: create-with-source-3
PASS: create-with-source-4
PASS: create-with-source-and-mapping-1
PASS: create-from-template-1
PASS: dcounter1
PASS: vformatter1
PASS: xport1
PASS: list1
PASS: pdp-calc1
============================================================================
Testsuite summary for rrdtool 1.8.0
============================================================================
# TOTAL: 25
# PASS:  25
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/tests'
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/tests'
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/tests'
Making check in etc
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/etc'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/etc'
Making check in doc
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/doc'
  GEN      bin_dec_hex.1
  GEN      bin_dec_hex.txt
  GEN      rrddump.1
  GEN      rrddump.txt
  GEN      rrdgraph_examples.1
  GEN      rrdgraph_examples.txt
  GEN      rrdrestore.1
  GEN      rrdrestore.txt
  GEN      rrdupdate.1
  GEN      rrdupdate.txt
  GEN      cdeftutorial.1
  GEN      cdeftutorial.txt
  GEN      rrdfetch.1
  GEN      rrdfetch.txt
  GEN      rrdgraph_graph.1
  GEN      rrdgraph_graph.txt
  GEN      rrdthreads.1
  GEN      rrdthreads.txt
  GEN      rrdxport.1
  GEN      rrdxport.txt
  GEN      rpntutorial.1
  GEN      rpntutorial.txt
  GEN      rrdfirst.1
  GEN      rrdfirst.txt
  GEN      rrdgraph_rpn.1
  GEN      rrdgraph_rpn.txt
  GEN      rrdtool.1
  GEN      rrdtool.txt
  GEN      rrdcached.1
  GEN      rrdcached.txt
  GEN      rrd-beginners.1
  GEN      rrd-beginners.txt
  GEN      rrdinfo.1
  GEN      rrdinfo.txt
  GEN      rrdtune.1
  GEN      rrdtune.txt
  GEN      rrdbuild.1
  GEN      rrdbuild.txt
  GEN      rrdflushcached.1
  GEN      rrdflushcached.txt
  GEN      rrdcgi.1
  GEN      rrdcgi.txt
  GEN      rrdgraph.1
  GEN      rrdgraph.txt
  GEN      rrdlast.1
  GEN      rrdlast.txt
  GEN      rrdlastupdate.1
  GEN      rrdlastupdate.txt
  GEN      rrdcreate.1
  GEN      rrdcreate.txt
  GEN      rrdgraph_data.1
  GEN      rrdgraph_data.txt
  GEN      rrdresize.1
  GEN      rrdresize.txt
  GEN      rrdtutorial.1
  GEN      rrdtutorial.txt
  GEN      rrd_pdpcalc.1
  GEN      rrd_pdpcalc.txt
  GEN      rrdlist.1
  GEN      rrdlist.txt
  GEN      rrdruby.1
  GEN      rrdruby.txt
  GEN      librrd.3
  GEN      librrd.txt
  GEN      bin_dec_hex.html
  GEN      rrddump.html
  GEN      rrdgraph_examples.html
  GEN      rrdrestore.html
  GEN      rrdupdate.html
  GEN      cdeftutorial.html
  GEN      rrdfetch.html
  GEN      rrdgraph_graph.html
  GEN      rrdthreads.html
  GEN      rrdxport.html
  GEN      rpntutorial.html
  GEN      rrdfirst.html
  GEN      rrdgraph_rpn.html
  GEN      rrdtool.html
  GEN      rrdcached.html
  GEN      rrd-beginners.html
  GEN      rrdinfo.html
  GEN      rrdtune.html
  GEN      rrdbuild.html
  GEN      rrdflushcached.html
  GEN      rrdcgi.html
  GEN      rrdgraph.html
  GEN      rrdlast.html
  GEN      rrdlastupdate.html
  GEN      rrdcreate.html
  GEN      rrdgraph_data.html
  GEN      rrdresize.html
  GEN      rrdtutorial.html
  GEN      rrd_pdpcalc.html
  GEN      rrdlist.html
  GEN      rrdruby.html
  GEN      librrd.html
  GEN      RRDs.pod
  GEN      RRDs.html
  GEN      RRDp.pod
  GEN      RRDp.html
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/doc'
Making check in examples
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/examples'
Making check in rrdcached
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/examples/rrdcached'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/examples/rrdcached'
make[2]: Entering directory '/home/diederik/dev/github/rrdtool-1.x/examples'
sed 's,@''exec_prefix@,/opt/rrdtool-1.8.0,' ./cgi-demo.cgi.in > cgi-demo.cgi
chmod a+x cgi-demo.cgi
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/examples'
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/examples'
make[1]: Entering directory '/home/diederik/dev/github/rrdtool-1.x'
make[1]: Nothing to be done for 'check-am'.
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x'

Desktop (please complete the following information):

  • Debian Bookworm (amd64)
@diederikdehaas
Copy link
Contributor Author

There's another compiler warning (with make check):

  • discarded-qualifiers
mkdir -p ./python
cd ./python \
  && ( test -e rrdtoolmodule.c || ln -s /home/diederik/dev/github/rrdtool-1.x/bindings/python/rrdtoolmodule.c ) \
          && env \
               ABS_TOP_SRCDIR=/home/diederik/dev/github/rrdtool-1.x \
               ABS_TOP_BUILDDIR=/home/diederik/dev/github/rrdtool-1.x \
               /usr/bin/python3 /home/diederik/dev/github/rrdtool-1.x/bindings/python/setup.py build_ext --rpath=/opt/rrdtool-1.8.0/lib \
          && env \
               ABS_TOP_SRCDIR=/home/diederik/dev/github/rrdtool-1.x \
               ABS_TOP_BUILDDIR=/home/diederik/dev/github/rrdtool-1.x \
               /usr/bin/python3 /home/diederik/dev/github/rrdtool-1.x/bindings/python/setup.py build
running build_ext
building 'rrdtool' extension
creating build
creating build/temp.linux-x86_64-cpython-311
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/diederik/dev/github/rrdtool-1.x/src -I/home/diederik/dev/github/rrdtool-1.x/src -I/usr/include/python3.11 -c rrdtoolmodule.c -o build/temp.linux-x86_64-cpython-311/rrdtoolmodule.o
rrdtoolmodule.c: In function ‘convert_args’:
rrdtoolmodule.c:157:43: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  157 |             (*rrdtool_argv)[++argv_count] = PyRRD_String_AS_STRING(o);
      |                                           ^
rrdtoolmodule.c:163:51: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  163 |                     (*rrdtool_argv)[++argv_count] = PyRRD_String_AS_STRING(lo);
      |                                                   ^
rrdtoolmodule.c: In function ‘_rrdtool_fetch_cb_wrapper’:
rrdtoolmodule.c:35:47: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   35 | #define PyRRD_String_AS_STRING(x)             PyUnicode_AsUTF8(x)
      |                                               ^~~~~~~~~~~~~~~~
rrdtoolmodule.c:1246:29: note: in expansion of macro ‘PyRRD_String_AS_STRING’
 1246 |             char *key_str = PyRRD_String_AS_STRING(key);
      |                             ^~~~~~~~~~~~~~~~~~~~~~
rrdtoolmodule.c:35:47: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   35 | #define PyRRD_String_AS_STRING(x)             PyUnicode_AsUTF8(x)
      |                                               ^~~~~~~~~~~~~~~~
rrdtoolmodule.c:1305:45: note: in expansion of macro ‘PyRRD_String_AS_STRING’
 1305 |                             char *exc_str = PyRRD_String_AS_STRING(exc_value_str);
      |                                             ^~~~~~~~~~~~~~~~~~~~~~
creating build/lib.linux-x86_64-cpython-311
x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-311/rrdtoolmodule.o -L/home/diederik/dev/github/rrdtool-1.x/src/.libs -L/usr/lib/x86_64-linux-gnu -Wl,--enable-new-dtags,-R/opt/rrdtool-1.8.0/lib -lrrd -o build/lib.linux-x86_64-cpython-311/rrdtool.cpython-311-x86_64-linux-gnu.so
running build
running build_ext
make[2]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
make[1]: Leaving directory '/home/diederik/dev/github/rrdtool-1.x/bindings'
Making check in tests

Maybe this one is unavoidable as it has to do with bindings, but figured I'd mention it anyway.

I think there are other warning when doing a full(er) build, but I'll leave that for now as I'm focused on make check.

@hramrach
Copy link
Contributor

#1242 addresses all but truncation warnings

hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 6, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 6, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 6, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 7, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 8, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
hramrach added a commit to hramrach/rrdtool-1.x that referenced this issue Jan 8, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: oetiker#1223
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
oetiker pushed a commit that referenced this issue Jan 8, 2024
There are a number of places where rrdtool combines multiple PATH_MAX
sized strings into one.

PATH_MAX is a constant that tends to work in practice a lot of the time
but may not reflect the real capabilities of the system in real time.

In place of on-stack buffers of PATH_MAX size allocate memory
dynamically. Initialize the pointers to NULL so they can be all freed
unconditionally on exit.

Fixes: #1223

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants