Skip to content

in modern C, errno is a macro that calls a function #398

@rumbledethumps

Description

@rumbledethumps

When stdio was added, cc65's errno behavior was inherited. Errors are sent through __mappederrno by the standard library. But why?

Modern C uses a macro that calls a function for errno. If we did this, all the error checking in the standard library can be skipped and apps that don't look at errno won't link in all the code and translation tables.

Also, __oserror should be a platform defined macro too if this is changed. Some platforms, like the RP6502, would then get this feature for 0 code and 0 data.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions