[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#681557: marked as done (gcc-4.7: misleading warning in xserver-xorg-input-mouse (array subscript is above array bounds))



Your message dated Wed, 08 May 2013 15:16:08 +0200
with message-id <518A5018.4030302@debian.org>
and subject line Re: Bug#681557: gcc-4.7: misleading warning in xserver-xorg-input-mouse (array subscript is above array bounds)
has caused the Debian Bug report #681557,
regarding gcc-4.7: misleading warning in xserver-xorg-input-mouse (array subscript is above array bounds)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
681557: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681557
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-4.7
Version: 4.7.1-2
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

current gcc produces (at least on kfreebsd-amd64) misleading warning during compilation of xserver-xorg-input-mouse.
It together with -Werror leads to #665390.

Attached please find reduced testcase, it probably produces the same warning also on (linux-)amd64.

gcc -Wall -O2 bsd_mouse-bounds.c -c
  bsd_mouse-bounds.c: In function 'CheckProtocol':
  bsd_mouse-bounds.c:35:30: warning: array subscript is above array bounds [-Warray-bounds]

Petr

extern int xf86NameCmp(const char *s1, const char *s2);
extern void *xcalloc(int, int);

typedef const char **(*BuiltinNamesProc)(void);
typedef int (*CheckProtocolProc)(const char *protocol);

typedef struct {
 BuiltinNamesProc BuiltinNames;
 CheckProtocolProc CheckProtocol;
} OSMouseInfoRec, *OSMouseInfoPtr;



static const char *internalNames[] = {
 ((void *)0)
};

static const char *miscNames[] = {
 "SysMouse",
 ((void *)0)
};

static const char **
BuiltinNames(void)
{
    return internalNames;
}


static int
CheckProtocol(const char *protocol)
{
    int i;

    for (i = 0; internalNames[i]; i++)
        if (xf86NameCmp(protocol, internalNames[i]) == 0)
            return 1;
    for (i = 0; miscNames[i]; i++)
        if (xf86NameCmp(protocol, miscNames[i]) == 0)
            return 1;
    return 0;

}
OSMouseInfoPtr
OSMouseInit(int flags)
{
    OSMouseInfoPtr p;

    p = xcalloc(sizeof(OSMouseInfoRec), 1);
    if (!p)
        return ((void *)0);
    p->BuiltinNames = BuiltinNames;
    p->CheckProtocol = CheckProtocol;

    return p;
}

--- End Message ---
--- Begin Message ---
tags 681557 + wontfix fixed-upstream
retitle 681557 [fixed in 4.8] misleading warning in xserver-xorg-input-mouse
(array subscript is above array bounds)
thanks


Am 14.07.2012 10:40, schrieb Petr Salinger:
> Package: gcc-4.7
> Version: 4.7.1-2
> User: debian-bsd@lists.debian.org
> Usertags: kfreebsd
> 
> Hi,
> 
> current gcc produces (at least on kfreebsd-amd64) misleading warning during
> compilation of xserver-xorg-input-mouse.
> It together with -Werror leads to #665390.
> 
> Attached please find reduced testcase, it probably produces the same warning
> also on (linux-)amd64.
> 
> gcc -Wall -O2 bsd_mouse-bounds.c -c
>   bsd_mouse-bounds.c: In function 'CheckProtocol':
>   bsd_mouse-bounds.c:35:30: warning: array subscript is above array bounds
> [-Warray-bounds]
> 
> Petr
> 

fixed in 4.8, won't fix in 4.7.

--- End Message ---

Reply to: