Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12794 - new EQ code does not compile for the Nokia N8x0

Attached to Project: Rockbox
Opened by Thomas Jarosch (thomasjfox) - Thursday, 27 December 2012, 21:31 GMT+2
Last edited by Michael Sevakis (MikeS) - Friday, 28 December 2012, 20:21 GMT+2
Task Type Bugs
Category Build environment
Status Closed
Assigned To Michael Sevakis (MikeS)
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.12
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Hi,

the Nokia N8x0 is stuck with a rather old gcc version. This piece of code fails to compile:

/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c: In function `dsp_set_eq_coefs':
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: initializer element is not constant
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: (near initialization for `coef_gen[1]')
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: initializer element is not constant
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: (near initialization for `coef_gen[2]')
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: initializer element is not constant
/home/maemo/MyProjects/rockbox/lib/rbcodec/dsp/eq.c:79: error: (near initialization for `coef_gen[3]')

gcc version: sbox-arm-linux-gcc (GCC) 3.4.4 (release) (CodeSourcery ARM 2005q3-2)


If I understand the code correctly, it's only called during EQ init / EQ changes and could be re-written with if() statements. Is that correct?

Thomas
This task depends upon

Closed by  Michael Sevakis (MikeS)
Friday, 28 December 2012, 20:21 GMT+2
Reason for closing:  Fixed
Additional comments about closing:  362ade3
Comment by Michael Sevakis (MikeS) - Friday, 28 December 2012, 07:43 GMT+2
Did you try moving the array to global scope? Those would involve initialzed ranges which shouldn't be unique. I've had GCC act weird with localized static variables and aggregates.
Comment by Michael Sevakis (MikeS) - Friday, 28 December 2012, 07:46 GMT+2
When I say "weird", I mean a newer gcc generates exactly those messages with nested static compound literals. So, just something to check out first.
Comment by Thomas Jarosch (thomasjfox) - Friday, 28 December 2012, 18:23 GMT+2
Ok,

I moved it outside the function and tried with and without the "static" keyword. Same error message.
This old gcc version seems to have trouble with the "x ... y" syntax + the pointer to a function.

This compiles fine:
"[1 ... EQ_NUM_BANDS-2] = NULL,"


Could we init this stuff once with an _init() function and remove the "x ... y" syntax?
Comment by Michael Sevakis (MikeS) - Friday, 28 December 2012, 19:27 GMT+2
Test this out. Then if...then approach is fine.
   fix-nokia-n8x0-eq-compile-01.patch (1.6 KiB)
 b/lib/rbcodec/dsp/eq.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Loading...