SDK 54.16 newlib math.h problem

Have a question about our Software Developer Kit? Ask them here.
Post Reply
blmara
Posts: 76
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

SDK 54.16 newlib math.h problem

Post by blmara »

Hi,

I've got a project that includes newlib math.h in one module. This is compiled with VBCC 0.9h. After installing SDK 54.16, including the SDK version of VBCC, I get this error when compiling the project

Code: Select all

'vbcc:bin/vc +newlib -cpp-comments -Lvlibos4: -ISDK:local/newlib/include/ -ISDK:local/common/include/ -g -static  -c -o o/lineclass.o lineclass.c
>          ((sizeof(x)==sizeof(float)) ? __fpclassifyf(x) : __fpclassifyd(x))
error 272 in line 282 of "math.h": macro 'fpclassify' redefined unidentically
    included from file "lineclass.c":30
1 error found!
vbccppc keskeytyi, palautuskoodi 20
vbccppc -quiet "lineclass.c" -o= "T:t_9_0.asm" -cpp-comments -ISDK:local/newlib/include/ -ISDK:local/common/include/ -g -elf -no-regnames -no-multiple-ccs -madd -setccs -use-commons -D__amigaos4__ -D__NEWLIB__ -D__mask=___mask  -O=1 -ISDK:local/common/include -ISDK:local/newlib/include -ISDK:newlib/include -ISDK:include/include_h failed
vbcc:bin/vc keskeytyi, palautuskoodi 20 
Asked about this from Frank Wille, the author of Amiga version of VBCC. His answer
I didn't check the new SDK yet, but it looks like a problem in the newlib
math.h from SDK 54.16, which is not part of vbcc.
          ((sizeof(x)==sizeof(float)) ? __fpclassifyf(x) :
__fpclassifyd(x))
error 272 in line 282 of "math.h": macro 'fpclassify' redefined
unidentically

My SDK has just:

extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);

Probably the new SDK has a second declaration for __fpclassifyX() somewhere?
Then this is a bug, which should be reported.
How and who to correct this problem?

Marko
Marko
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: SDK 54.16 newlib math.h problem

Post by salass00 »

Since it complains that fpclassify is being redefined unidentically can you find where the other definition is (is it in the program you are compiling, a vbcc internal header or ...)? When using gcc and it encounters a problem like this it lists also the previous definition which is a quite handy feature.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: SDK 54.16 newlib math.h problem

Post by salass00 »

Okay, I found the problem: The fpclassify macro is first defined in a compiler generic section nearer the top of the header file and then defined again lower down in a VBCC specific section.

This modified math.h header file should fix the double macro definitions when using VBCC:
https://www.dropbox.com/s/oh1rf9quvgel7aa/math.h?dl=0
blmara
Posts: 76
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: SDK 54.16 newlib math.h problem

Post by blmara »

Thanks and sorry for delay replying,

the DropBox link provided in the previous message doesn't seem to work with Amiga Browsers (Odyssey, Netsurf) but with the help of my Android phone I manage to download the new math.h. Now it compiles flawlessly with VBCC. Thanks a lot! Hopefully this will go to the next update of SDK.

Marko
Marko
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: SDK 54.16 newlib math.h problem

Post by Raziel »

The link works if you change the last 0 to 1.

dl=1 means the site won't load, instead it will immediately download the file
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Post Reply