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

Fixed-width integer type aliases are leaked from USBAPI.h #510

Open
inicula opened this issue Nov 5, 2022 · 1 comment
Open

Fixed-width integer type aliases are leaked from USBAPI.h #510

inicula opened this issue Nov 5, 2022 · 1 comment

Comments

@inicula
Copy link

inicula commented Nov 5, 2022

It seems inappropriate that u8, u16, and u32 are leaked from USBAPI.h, which in turn is included in Arduino.h, and thus polluting the global namespace:

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;

If you try to define u16 yourself as using u16 = uint16_t; while including Arduino.h, you'll get a compilation error because this alias conflicts with the one from USBAPI.h.

Is this behavior intended?

@matthijskooijman
Copy link
Collaborator

Sounds wrong to me, I'd be in favor of removing them. Especially since (at first glance) it seems the header file does not actually use these types at all either.

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

2 participants