Mercurial > vim
comparison src/evalvars.c @ 28990:84a6794a9320 v8.2.5017
patch 8.2.5017: gcc 12.1 warns for uninitialized variable
Commit: https://github.com/vim/vim/commit/8be36eecdc6728021f9c384c2305f114e671ec32
Author: mityu <mityu.mail@gmail.com>
Date: Wed May 25 17:29:46 2022 +0100
patch 8.2.5017: gcc 12.1 warns for uninitialized variable
Problem: Gcc 12.1 warns for uninitialized variable.
Solution: Initialize the variable. (closes https://github.com/vim/vim/issues/10476)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 25 May 2022 18:30:02 +0200 |
parents | 006d525419fa |
children | a74398c432a4 |
comparison
equal
deleted
inserted
replaced
28989:65b740512fbf | 28990:84a6794a9320 |
---|---|
2021 int | 2021 int |
2022 do_unlet(char_u *name, int forceit) | 2022 do_unlet(char_u *name, int forceit) |
2023 { | 2023 { |
2024 hashtab_T *ht; | 2024 hashtab_T *ht; |
2025 hashitem_T *hi; | 2025 hashitem_T *hi; |
2026 char_u *varname; | 2026 char_u *varname = NULL; // init to shut up gcc |
2027 dict_T *d; | 2027 dict_T *d; |
2028 dictitem_T *di; | 2028 dictitem_T *di; |
2029 | 2029 |
2030 // can't :unlet a script variable in Vim9 script | 2030 // can't :unlet a script variable in Vim9 script |
2031 if (in_vim9script() && check_vim9_unlet(name) == FAIL) | 2031 if (in_vim9script() && check_vim9_unlet(name) == FAIL) |