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

B0 define conflicts on Linux with user code #35

Closed
certik opened this issue Oct 30, 2019 · 2 comments · Fixed by #36
Closed

B0 define conflicts on Linux with user code #35

certik opened this issue Oct 30, 2019 · 2 comments · Fixed by #36

Comments

@certik
Copy link
Collaborator

certik commented Oct 30, 2019

Due to this define:

https://github.com/bminor/glibc/blob/0b262ca4c64cd9042576ddb9969607c0ea1187d7/bits/termios.h#L288

user code can break. To fix it, we should but

#undef B0

right after including termios.h. The same for all the other constants.

Reported by @KineticTheory.

@certik
Copy link
Collaborator Author

certik commented Oct 30, 2019

This seems to be a known problem, e.g.:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=365

https://www.mit.edu/afs.new/athena/astaff/source/src-8.2/third/tcsh/mi.termios.c

android/ndk#630

linbox-team/fflas-ffpack#57

lvgl/lvgl#941 (comment)

https://gitlab.mech.kuleuven.be/rob-expressiongraphs/luabind/commit/418e4c852dfa027c386153396534ccf079efbfee

Most codes decided to rename B0 to something else to avoid this collision. But the other solution is to simply undefine such a macro.

I also found this note, which lists the reserved names that programs should not use. B0 is among them ("names prefixed with B followed by a digit):

https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html

@KineticTheory
Copy link
Contributor

This seems to be a known problem, e.g.:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=365

https://www.mit.edu/afs.new/athena/astaff/source/src-8.2/third/tcsh/mi.termios.c

android/ndk#630

linbox-team/fflas-ffpack#57

littlevgl/lvgl#941 (comment)

https://gitlab.mech.kuleuven.be/rob-expressiongraphs/luabind/commit/418e4c852dfa027c386153396534ccf079efbfee

Most codes decided to rename B0 to something else to avoid this collision. But the other solution is to simply undefine such a macro.

I also found this note, which lists the reserved names that programs should not use. B0 is among them ("names prefixed with B followed by a digit):

https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html

Wow! Thanks for all of the links. I’ll pass this along.

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

Successfully merging a pull request may close this issue.

2 participants