rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
365 stars 1.15k forks source link

Improve error message with unsupported cpp #4207

Open mrgriffin opened 8 months ago

mrgriffin commented 8 months ago

Description

Currently, if you have a cpp that's too old you get an error like this when compiling:

src/battle_main.c:338:84: error: expected expression before ',' token
  338 |     TRAINER_CLASS(HIKER, "HIKER", 10),

This has come up a few times on Discord, most recently today. It's not at all clear what the problem is, especially because the error message doesn't even say __VA_OPT__.

We could probably give a better error message by detecting __VA_OPT__ support in metaprogram.h, and using #error to give an explicit message rather than this very weird and confusing Hiker one.

Version

upcoming (Edge)

Upcoming/master Version

No response

Discord contact info

No response

AsparagusEduardo commented 7 months ago

4272

AsparagusEduardo commented 7 months ago

Still has the issue: https://github.com/rh-hideout/pokeemerald-expansion/pull/4272#issuecomment-2004511248

hedara90 commented 2 months ago

If the problem is with unsupported cpp, couldn't the version be detected and make process made to error out completely if support doesn't exist in that version?