Bug 4623 - pm2v_dac.c:224: warning: array subscript out of range
Summary: pm2v_dac.c:224: warning: array subscript out of range
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/glint (show other bugs)
Version: 6.8.2
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-28 06:11 UTC by dcb314
Modified: 2006-02-02 14:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description dcb314 2005-09-28 06:11:21 UTC
I just tried to compile Fedora development package xorg-x11-6.8.2-54
with a special non-standard version of the usual GNU C compiler.

The compiler said

pm2v_dac.c:224: warning: array subscript out of range
pm2v_dac.c:225: warning: array subscript out of range
pm2v_dac.c:226: warning: array subscript out of range

The source code is

	pReg->DacRegs[PM2VDACRDDClk0PreScale] = m;

but

../BUILD/xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h:#define
PM2VDACRDDClk0PreScale                                               0x201

and

../BUILD/xorg-x11-6.8.2/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h:
CARD32 DacRegs[0x100];

Suggest code rework. Similar fun and games at 

pm2v_dac.c:332: warning: array subscript out of range
pm2v_dac.c:333: warning: array subscript out of range
pm2v_dac.c:334: warning: array subscript out of range
pm2v_dac.c:399: warning: array subscript out of range
pm2v_dac.c:399: warning: array subscript out of range
pm2v_dac.c:401: warning: array subscript out of range
pm2v_dac.c:401: warning: array subscript out of range
pm2v_dac.c:403: warning: array subscript out of range
pm2v_dac.c:403: warning: array subscript out of range
Comment 1 Alan Hourihane 2006-02-03 09:56:12 UTC
Thanks for the report. I'll fix this now and commit to CVS.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.