Also I have described it incorrectly. It is supposed to point to a
List sized chunk of memory. I am a newbie C programmer, please be
patient.

On Sun, Feb 7, 2016 at 3:04 PM, Pavan Maddamsetti
<pavan.maddamse...@gmail.com> wrote:
> Excuse me, here is the "reply all"
>
> On Sun, Feb 7, 2016 at 3:01 PM, Pavan Maddamsetti
> <pavan.maddamse...@gmail.com> wrote:
>> Thanks for responding. At first, listp points at an uninitialized
>> pointer-sized chunk of stack memory. Depending on the contents of ap
>> and bp, it gets overwritten with either of those two pointers.
>>
>> On Sun, Feb 7, 2016 at 2:56 PM, Philip Guenther <guent...@gmail.com> wrote:
>>> On Sun, Feb 7, 2016 at 11:36 AM, Pavan Maddamsetti
>>> <pavan.maddamse...@gmail.com> wrote:
>>>> /*
>>>>  * Here 's the code. Try commenting out the line that says "WTF mate!"
>>>>  * On my machine, the loop never returns. Somehow printf makes it work.
>>>>  * Compiler bug or not? Please compile and confirm.
>>>
>>> Compiler bug should always be the *last* thing you conclude, as it
>>> means you've given up on looking for the bug in your own code.
>>>
>>>
>>>> List *
>>>> merge(List *ap, List *bp)
>>>> {
>>>>         List *listp;
>>>>         List **last;
>>>>         last = &listp;
>>>>
>>>>         for (;;) {
>>>>                 if (ap == NULL) {
>>>>                         (*last)->next = bp;
>>>
>>> Where does listp point?
>>>
>>>
>>> Philip Guenther

Reply via email to