Date: Sat, 10 Feb 2018 17:17:15 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329106 - head/usr.bin/tftp Message-ID: <201802101717.w1AHHFUE014200@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Sat Feb 10 17:17:15 2018 New Revision: 329106 URL: https://svnweb.freebsd.org/changeset/base/329106 Log: Fix uninitialized warning, and work around a bug in gcc over clobbering Summary: r329077 caused gcc to emit uninitialized use warnings. Attempting to fix those warnings yielded the following warnings: usr.bin/tftp/main.c: In function 'main': usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by 'longjmp' or 'vfork' usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by 'longjmp' or 'vfork' This is a known bug in gcc, found at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 Work around that by simply marking hist and el as static. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14302 Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Sat Feb 10 17:09:51 2018 (r329105) +++ head/usr.bin/tftp/main.c Sat Feb 10 17:17:15 2018 (r329106) @@ -178,8 +178,8 @@ int main(int argc, char *argv[]) { HistEvent he; - EditLine *el; - History *hist; + static EditLine *el; + static History *hist; bool interactive; acting_as_client = 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802101717.w1AHHFUE014200>