Rockbox

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, 20:31 GMT
Last edited by Michael Sevakis (MikeS) - Friday, 28 December 2012, 19:21 GMT
Task Type Bugs
Category Build environment
Status Closed
Assigned To Michael Sevakis (MikeS)
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.12
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
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, 19:21 GMT
Reason for closing:  Fixed
Additional comments about closing:  362ade3
Comment by Michael Sevakis (MikeS) - Friday, 28 December 2012, 06:43 GMT
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, 06:46 GMT
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, 17:23 GMT
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, 18:27 GMT
Test this out. Then if...then approach is fine.

Loading...