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

proposal: additional prefix to avoid name collision #66

Open
diggit opened this issue Nov 22, 2019 · 3 comments
Open

proposal: additional prefix to avoid name collision #66

diggit opened this issue Nov 22, 2019 · 3 comments

Comments

@diggit
Copy link

diggit commented Nov 22, 2019

I propose to add prefix to all exposed functions using eg. macro. This is to avoid possible name collision with stdio and other libraries when used.

What do you think?

@mpaland
Copy link
Owner

mpaland commented Jan 1, 2020

All exposed functions end with _, and there are defines which define the function name, e.g.

#define printf printf_
int printf_(const char* format, ...);

So IMHO there won't be a function name collision.

@ryanwinter
Copy link

ryanwinter commented Feb 14, 2020

I noticed that it does an:
#undef printf

which results in a linker error when it tries to pull the global printf into the std namespace:
toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\cstdio:127:11: error: '::printf' has not been declared

I don't understand why it can't find the original printf defined in stdio.h, but the is included by a 3rd party library.

@eyalroz
Copy link

eyalroz commented Aug 3, 2021

On my fork, what I've done so far is make the aliasing of the standard-library function be disabled by default, with a CMake-controlled #define allowing it to happen if necessary.

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

4 participants