qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target/m68k: Change fpu_rom from const static a


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] target/m68k: Change fpu_rom from const static array to switch
Date: Sun, 3 Sep 2017 21:27:49 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 09/03/2017 02:05 PM, Laurent Vivier wrote:
Le 03/09/2017 à 18:31, Kamil Rytarowski a écrit :
GCC 4.7.2 on SunOS reports that the values assigned to array members are not
real constants:

target/m68k/fpu_helper.c:32:5: error: initializer element is not constant
target/m68k/fpu_helper.c:32:5: error: (near initialization for 'fpu_rom[0]')
rules.mak:66: recipe for target 'target/m68k/fpu_helper.o' failed

Convert the array to switch() to workaround the issue.

I don't like the idea. It's really an array and should be managed as an
array.

I agree with Laurent.


Could you try to use make_floatx80_init() instead of make_floatx80() ?

I guess the problem comes from the macro which cast as not const:

#define make_floatx80(exp, mant) ((floatx80) { mant, exp })

make_floatx80_init() doesn't cast so it might work,
else we could add a macro such const_floatx80():

#define const_floatx80(exp, mant) ((const floatx80) { mant, exp })



reply via email to

[Prev in Thread] Current Thread [Next in Thread]