Re: Possible Incorrect Pointer Reference in variable.c
Paul Eggert <[email protected]> Mon, 27 Sep 2021 13:44:09 -0700
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Organization | UCLA Computer Science Department |
| Message-ID | <[email protected]> |
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!