diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-28 16:06:33 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-04-28 16:23:14 +0200 |
| commit | f7b42b2c26481734a4214aac856b33a942c93c23 (patch) | |
| tree | b74cf59ddc46af97cfc8e67ab2d60164c454f93d /tests/code.nes | |
| parent | b489dd284cd6388779fef60c7283fcaf3a090cd6 (diff) | |
| download | tools.nes-f7b42b2c26481734a4214aac856b33a942c93c23.tar.gz tools.nes-f7b42b2c26481734a4214aac856b33a942c93c23.zip | |
Send an error for unused .proc's
We cannot safely detect all scenarios in which there is dead code, but
we can safely do it for .proc's. Even if they are not called directly,
they might be referenced via jump tables and shenanigans like that. Long
story short, if you are not referencing a .proc in any meaningful way,
then we have dead code.
A pattern could also be given in which a function that was too long has
been splitted into smaller functions which are not called
directly. This is, in my opinion, an anti-pattern (as we generally
expect an rts or a jmp from .proc's), and anyways can be avoided via the
use of __fallthrough__ if the programmer is really set to write this
kind of code.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'tests/code.nes')
0 files changed, 0 insertions, 0 deletions
