Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on variable of enumaterated type #95

Open
wileur opened this issue Apr 30, 2021 · 0 comments
Open

Fails on variable of enumaterated type #95

wileur opened this issue Apr 30, 2021 · 0 comments

Comments

@wileur
Copy link

wileur commented Apr 30, 2021

It seems that clang2py parses but doesn't produce any output if the file contains a variable of an enumerated type. Running with --debug showed processing of all lines but no resulting definitions wwere printed to the terminal or output file. By commenting out line by line I finally boiled it down to the lines below.

Code:

typedef enum DETECTOR_RUN_STATES {
DETECTOR_RUN_STATE_TO_IDLE, ///< Transition to Idle
DETECTOR_RUN_STATE_IDLE, ///< Doing setup or in charger
DETECTOR_RUN_STATE_TO_PREPARE, ///< Transition to Prepare
DETECTOR_RUN_STATE_PREPARE, ///< Preparing to go active
DETECTOR_RUN_STATE_TO_ACTIVE, ///< Transition to Active
DETECTOR_RUN_STATE_ACTIVE ///< Active
} DETECTOR_RUN_STATES_T;

// This doesn't work:
//extern DETECTOR_RUN_STATES_T DETECTOR_runState;

// This works fine
extern uint8_t DETECTOR_runState;

Please note that this is not a huge issue or showstopper for me, as far as I know enumerated types are mostly useful for getting nice output in a debugger that supports it. Using an uint8_t works fine, but I thought this could be useful for others.

Best regards,
Andreas Wileur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant