|
From: | Paul Eggert |
Subject: | Re: Possible Incorrect Pointer Reference in variable.c |
Date: | Mon, 27 Sep 2021 13:44:09 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 9/27/21 13:39, Paul Smith wrote:
1644 if (flocp != 0) 1645 v.fileinfo = *flocp; 1646 else 1647 v.fileinfo.filenm = 0; ----- How can line #1647 ever work? "v" is a newly created local variable, which means "v.fileinfo" hasn't been given a value yet, which means that "v.fileinfo.filenm" could be anywhere.It could be any value, that's true. But we are assigning it here, not using it so...? Maybe I'm misunderstanding the problem you're pointing to.
I guess Jon is so used to Java-like languages that he's not appreciating that this is C and v.fileinfo is a struct not a pointer so there's no bug here.
If my guess is right, your last line is a wonderful pun!
[Prev in Thread] | Current Thread | [Next in Thread] |