RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
204 stars 44 forks source link

Make warnings more customizable #13

Open RPGHacker opened 6 years ago

RPGHacker commented 6 years ago

Make warnings more customizable like in MSVC, clang etc.

Some examples: -Add support for "warnings as errors" -Add support for warnings levels (print only warnigns of the current level or higher) -Give all warnings an ID/number and add support for disabling/enable warnings per its ID -Maybe support for disabling/enabling certain warnings or pushing/popping warnings settings from within an asm file (for example: @pushwarnings and @pullwarnings)

randomdude999 commented 6 years ago

List of warnings generated by Asar

manual pass check:
assembleblock.cpp:1030: Manual warn without argument (pass 2)
assembleblock.cpp:1038: Manual warn with argument (pass 2)
assembleblock.cpp:1054: \ Expecttitle mismatch, title checks disabled
assembleblock.cpp:1079: / (pass 0)

warn0:
arch-65816.cpp:137: ($yy),x does not exist, assuming $yy,x
arch-65816.cpp:157: $xx,y is not valid with 8-bit parameters, assuming 16-bit
arch-spc700.cpp:318: This opcode does not exist with 16-bit parameters, assuming 8-bit
assembleblock.cpp:60: missing org or freespace command
assembleblock.cpp:359:  \
assembleblock.cpp:854:  |
assembleblock.cpp:1349: | Asar-only commands in ;@xkas patch
assembleblock.cpp:1525: |
assembleblock.cpp:1556: |
assembleblock.cpp:1962: |
main.cpp:372:           /
assembleblock.cpp:1129: \ xkas deprecation warning
assembleblock.cpp:1990: /
assembleblock.cpp:1158: db "STAR" warning
assembleblock.cpp:1224: org $005000 in LoROM
assembleblock.cpp:1631: warnpc is relaxed 1 byte
assembleblock.cpp:1647: rep -1 warning
assembleblock.cpp:1662: \ xkas incsrc relative to assembler warning
assembleblock.cpp:1701: /
assembleblock.cpp:1674: \ '\' in file path warning
assembleblock.cpp:1713: /
assembleblock.cpp:2010: Unrecognized special command
main.cpp:354: parentheses after defines

warn1:
main.cpp:134: label optimization warning

warn2:
assembleblock.cpp:1419: \ Freespace leak warning
assembleblock.cpp:1755: /

Now we should probably assign each one an ID and possibly a short (1 or 2 hyphen separated words) description.

RPGHacker commented 6 years ago

Nice work! I would probably go with IDs (four-digit IDs like in Visual Studio), since I think they're a bit easier to work with internally (setting states for them would be as easy as writing into an array, we would only have to make this array sufficiently large). And I guess we should also have a severity level, kinda like Visual Studio.

RPGHacker commented 6 years ago

This is now mostly implemented with commit 44899c6924a54b0dd83b4c464be46d81e613d3c3. The only thing that's still missing is adding the new API to the C# and Python bindings. Don't feel like doing that myself right now, since we don't have any test suites for C#/python and thus I don't really want to mess with the APIs.