Hi,

when compiling the latest head, I'm getting the following warning:


phc2sys.c: In function ‘main’:
phc2sys.c:653:11: warning: ‘phc_ts’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    phc_ts -= phc_offset;
           ^
phc2sys.c:628:19: note: ‘phc_ts’ was declared here
  uint64_t pps_ts, phc_ts;
                   ^
phc2sys.c:653:11: warning: ‘phc_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    phc_ts -= phc_offset;
           ^
phc2sys.c:627:22: note: ‘phc_offset’ was declared here
  int64_t pps_offset, phc_offset, phc_delay;
                      ^


The compiler is right. If do_pps_loop() is called with node->phc_readings==0 , phc_ts and phc_offset are used uninitialized.

Regards
Petr
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to