Re: Extending Error Codes

Puzdrowski, Andrzej

I also see that error cods defined in <errno.h> are insufficient.
I think definition value-space for module specific codes are good idea in general. But I'm afraid we can go down the road in case we relaxed the line.
Also we can consider addition of generic codes to existing definitions (which is better idea).


-----Original Message-----
From: [] On Behalf Of laczenJMS
Sent: Friday, April 27, 2018 5:32 PM
Subject: [Zephyr-devel] Extending Error Codes

Hello Zephyr Developers,

I recently had a request to change the error codes in a zephyr module to use the standard supplied error codes. Doing so would reduce the descriptiveness of the error codes so I did not really like this.
However in my module I was using error codes (-) 1 to 10, and I think this was a bad idea. If someone needs to check the error code he/she might end up looking at errno.h and finding a completely different definition.

Would it not be a good idea to allow extending the standard error codes with module (subsystem) specific error codes that can be as descriptive as required by allowing modules to use error codes above a specific value. E.g. any module can use it's own error codes starting from 0x7F00 to 0x7FFF. This way it is possible to avoid overlap between standard errors and "user" errors.

What's your opinion ?

Kind regards,


Join to automatically receive all group messages.