✘gcc 8.2.0 warnings

Gary E. Miller gem at rellim.com
Fri Aug 31 01:21:49 UTC 2018


Yo All!

I recently updated to gcc 8.2.0.  Of course it leads to new warnings.

[ 80/135] Compiling ntpd/refclock_pps.c
../../ntpd/refclock_trimble.c:179:2: warning: initialization of 'void (*)(int,  struct refclockproc *)' from incompatible pointer type 'void (*)(int,  struct peer *)' [-Wincompatible-pointer-types]
  trimble_shutdown, /* shut down driver */
  ^~~~~~~~~~~~~~~~
../../ntpd/refclock_trimble.c:179:2: note: (near initialization for 'refclock_trimble.clock_shutdown')

[...]

[ 86/135] Compiling ntpd/refclock_modem.c
In file included from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../ntpd/refclock_gpsd.c:70:
../../ntpd/refclock_gpsd.c: In function 'gpsd_shutdown':
../../ntpd/refclock_gpsd.c:626:21: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=]
        (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", unit));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~
../../include/ntp_syslog.h:61:11: note: in definition of macro 'LOGIF'
   msyslog msl_args;    \
           ^~~~~~~~
../../ntpd/refclock_gpsd.c:626:21: warning: format '%d' expects a matching 'int' argument [-Wformat=]
        (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", unit));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/ntp_syslog.h:61:11: note: in definition of macro 'LOGIF'
   msyslog msl_args;    \
           ^~~~~~~~

[...]

[ 87/135] Compiling ntpd/refclock_local.c
../../ntpd/refclock_oncore.c: In function 'oncore_get_timestamp':
../../ntpd/refclock_oncore.c:1812:32: warning: '__builtin___snprintf_chk' output 
may be truncated before the last format character [-Wformat-truncation=]
    snprintf(f3, sizeof(f3), "%d",
                                ^
In file included from /usr/include/stdio.h:862,
                 from ../../include/ntp_syslog.h:8,
                 from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../include/ntpd.h:11,
                 from ../../ntpd/refclock_oncore.c:150:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 2 and 6 bytes into a destination of size 5
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/refclock_oncore.c:1774:33: warning: '__builtin___snprintf_chk' output may be truncated before the last format character [-Wformat-truncation=]
    snprintf(f3, sizeof(f3), "%2d",
                                 ^
In file included from /usr/include/stdio.h:862,
                 from ../../include/ntp_syslog.h:8,
                 from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../include/ntpd.h:11,
                 from ../../ntpd/refclock_oncore.c:150:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 3 and 6 bytes into a destination of size 5
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[...]

[ 91/135] Compiling ntpd/ntp_loopfilter.c
../../ntpd/refclock_neoclock.c: In function 'neoclock4x_control':
../../ntpd/refclock_neoclock.c:668:50: warning: '%s' directive output may be truncated writing up to 79 bytes into a region of size 69 [-Wformat-truncation=]
       snprintf(tt, sizeof(tmpbuf)-1, "calc_utc=\"%s\"", tmpbuf);
                                                  ^~     ~~~~~~
In file included from /usr/include/stdio.h:862,
                 from ../../include/ntp_syslog.h:8,
                 from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../include/ntpd.h:11,
                 from ../../ntpd/refclock_neoclock.c:21:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 12 and 91 bytes into a destination of size 79
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[...]

[ 95/135] Compiling ntpd/ntp_sandbox.c
../../ntpd/refclock_generic.c: In function 'gps16x_message':
../../ntpd/refclock_generic.c:4130:56: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 115 [-Wformat-truncation=]
        snprintf(buffer, sizeof(buffer), "gps_message=\"%s\"", buffer1);
                                                        ^~     ~~~~~~~
In file included from /usr/include/stdio.h:862,
                 from ../../include/ntp_syslog.h:8,
                 from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../include/timespecops.h:11,
                 from ../../ntpd/refclock_generic.c:27:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 15 and 142 bytes into a destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 96/135] Compiling ntpd/ntp_scanner.c
../../ntpd/refclock_jjy.c:335:2: warning: initialization of 'void (*)(int,  struct refclockproc *)' from incompatible pointer type 'void (*)(int,  struct peer *)' [-Wincompatible-pointer-types]
  jjy_shutdown, /* shutdown driver */
  ^~~~~~~~~~~~
../../ntpd/refclock_jjy.c:335:2: note: (near initialization for 'refclock_jjy.clock_shutdown')

[ 99/135] Compiling ntpd/ntpd.c
../../ntpd/ntp_loopfilter.c: In function 'ntp_adjtime_error_handler':
../../ntpd/ntp_loopfilter.c:377:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sClock Unsynchronized",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:381:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sClock Error",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:386:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but no PPS",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:391:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but no PPS signal",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:396:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but PPS Jitter exceeded",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:401:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but PPS Wander exceeded",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:406:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but Calibration error detected",
             ^~~
     des, (*des) ? "; " : "");
     ~~~      
../../ntpd/ntp_loopfilter.c:377:36: warning: 'Clock Unsynchronized' directive output may be truncated writing 20 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sClock Unsynchronized",
                                    ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 21 and 1044 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:381:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sClock Error",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 12 and 1037 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:386:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but no PPS",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 37 and 1062 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:391:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but no PPS signal",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 39 and 1064 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:396:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but PPS Jitter exceeded",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 45 and 1070 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:401:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but PPS Wander exceeded",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 50 and 1075 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ntpd/ntp_loopfilter.c:406:34: warning: '%s' directive output may be truncated writing up to 2 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
    snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but Calibration error detected",
                                  ^~
In file included from /usr/include/stdio.h:862,
                 from ../../ntpd/ntp_loopfilter.c:10:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 57 and 1082 bytes into a destination of size 1024
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[...]

[234/243] Compiling build/main/ntpclients/ntpviz-man.txt.man-tmp
../../tests/ntpd/leapsec.c: In function 'TEST_leapsec_lsQueryPristineState_':
../../tests/ntpd/leapsec.c:435:19: warning: cast between incompatible function ty
pes from 'int (*)(FILE * restrict,  const char * restrict,  ...)' {aka 'int (*)(struct _IO_FILE * restrict,  const char * restrict,  ...)'} to 'void (*)(void *, const char *, ...)' [-Wcast-function-type]
  leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
                   ^
../../tests/ntpd/leapsec.c: In function 'TEST_leapsec_ls2009limdata_':
../../tests/ntpd/leapsec.c:555:19: warning: cast between incompatible function types from 'int (*)(FILE * restrict,  const char * restrict,  ...)' {aka 'int (*)(struct _IO_FILE * restrict,  const char * restrict,  ...)'} to 'void (*)(void *, const char *, ...)' [-Wcast-function-type]
  leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
                   ^
../../tests/ntpd/leapsec.c: In function 'TEST_leapsec_addDynamic_':
../../tests/ntpd/leapsec.c:606:19: warning: cast between incompatible function types from 'int (*)(FILE * restrict,  const char * restrict,  ...)' {aka 'int (*)(struct _IO_FILE * restrict,  const char * restrict,  ...)'} to 'void (*)(void *, const char *, ...)' [-Wcast-function-type]
  leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
                   ^





RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20180830/3de59557/attachment-0001.bin>


More information about the devel mailing list