diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-02-10 17:17:15 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-02-10 17:17:15 +0000 |
commit | e4803b1c14292f5085f8544f34daa3ceb00ba4e4 (patch) | |
tree | 7b606940f912b3a5c1c176a6462b2310ca05c3b4 /usr.bin/tftp | |
parent | 6cd3353ba3043275400d8a45eebbe47d1efc709e (diff) | |
download | src-test2-e4803b1c14292f5085f8544f34daa3ceb00ba4e4.tar.gz src-test2-e4803b1c14292f5085f8544f34daa3ceb00ba4e4.zip |
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
Notes
Notes:
svn path=/head/; revision=329106
Diffstat (limited to 'usr.bin/tftp')
-rw-r--r-- | usr.bin/tftp/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index b76fbe3192a7..b7972add4008 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -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; |