Page MenuHomePhabricator

eolian "error" enum values overlap standard libc error codes
Closed, ResolvedPublic

Description

Example:

build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_NONE = 0, /**< No error on load */
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT = 6, /**< File is not a known format
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED = 7, /**< Reading operation has been
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_INCOMPATIBLE_FILE = 8, /**< (Edje only) The file
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_UNKNOWN_COLLECTION = 9, /**< (Edje only) The
build/src/lib/efl/interfaces/efl_gfx_types.eot.h:  EFL_GFX_IMAGE_LOAD_ERROR_RECURSIVE_REFERENCE = 10 /**< (Edje only) The

This is fine for the no error case (0), but shouldn't the subsequent values start above the max value of errno?

zmike created this task.Feb 28 2019, 10:52 AM
zmike triaged this task as Showstopper Issues priority.

This shouldn't be returned as an Eina.Error. It should only be an allocated Eina.Error. Eolian is currently unable to allocate Eina.Error by itself, so this should be moved outside of the .eo.

It isn't returned as Eina.Error, but I was of the impression that errors like this should be usable interchangeably with Eina.Error codes?

No, they can't as Eina.Error can only know about system one. Looking at them, I really think they should be an Eina.Error and not an enum. Seems a remnant of the legacy API.