delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/10/06:00:32

Date: Tue, 10 Nov 1998 10:44:55 +0000 (GMT)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: DJGPP <djgpp AT delorie DOT com>
Subject: Re: Bug in gcc ?
In-Reply-To: <000401be0c83$4ab6dde0$97afccc2@d9a9a4>
Message-ID: <Pine.OSF.4.05.9811101024340.28894-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Tue, 10 Nov 1998, Daniel Mironowicz wrote:

> Hi,
> Here's what i've found:
> 
> #include <conio.h>
> 
> int main(void)
> {
>     int ptr[10];
>     int p = ptr[1],        // check out the ending of this line
>     getch();                // if you remove this line gcc displays error
> msg
> }

When you make bug reports, please say what you thought should
happen and what actually did happen.  Most of the time the
problem in this sort of case is that the user's expectations are
wrong.  I can't judge in this case because you don't say what
your expectations are.

If you remove the marked line you get:

    {
        int ptr[10];
 *      int p = ptr[1],
    }

The list in line * is not complete, so gcc reports the error.
What did you expect?

(Also note that `ptr' isn't actually a pointer)

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do jimpe  --  http://xiron.pc.helsinki.fi/lojban/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019