bug between libtonc and grit

Post Reply
Rickey
Posts: 1
Joined: Sat May 24, 2025 11:23 pm

bug between libtonc and grit

Post by Rickey » Sat May 24, 2025 11:41 pm

Greetings! :D

Since libtonc was updated to 1.4.5 (specifically this commit). The type tonc uses for s32/u32 has changed to using stdint.h types "int32_t"/"uint32_t" which is implemented as "long int" and "long unsigned int". This is from stdint.h from arm-none-eabi-gcc provided with devkitARM. My projects started to break after updating to the recent pacman upgrades. :cry: :roll:

I made a PR for grit here. Be nice to get this into the pacman releases to keep that ecosphere running good. :lol:


WinterMute
Site Admin
Posts: 2052
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: bug between libtonc and grit

Post by WinterMute » Sun May 25, 2025 5:21 pm

grit didn't output s32/u32 types, you shouldn't have been using those types to access data added via grit. This is a bug in your code, it isn't a mismatch between libtonc and grit.

Help keep devkitPro toolchains free, Donate today

Personal Blog

Rickey
Posts: 1
Joined: Sat May 24, 2025 11:23 pm

Re: bug between libtonc and grit

Post by Rickey » Mon May 26, 2025 1:36 am

Hey, I understand that grit doesn't use tonc types, but I don't think it's out of reason to assume that when grit outputs a tile array, that it would match with the same types tonc expects. The issue is that tonc's u32/s32 are now considered "long int" since v1.4.5 released. I made the PR to fix issues with grit outputting "unsigned int" where tonc expected "unsigned long". But, this issue only is one of many from that change. For example, when building tonc-examples, I see that the FIXED type is now "long int" causing some projects not to build. Error for that here: https://pastebin.com/w3r8R3c1 .

Not sure how deep this would go, but I do think that commit I linked for tonc should be reverted in the meantime.

Last edited by Rickey on Mon May 26, 2025 1:49 am, edited 1 time in total.

WinterMute
Site Admin
Posts: 2052
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: bug between libtonc and grit

Post by WinterMute » Mon May 26, 2025 10:42 am

This is clearly an error in the example code though. You shouldn't prototype functions with one type and then implement them with another

Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest