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

Use a namespace linux,but it expand as a macro #77

Open
asdadj opened this issue Aug 20, 2023 · 6 comments
Open

Use a namespace linux,but it expand as a macro #77

asdadj opened this issue Aug 20, 2023 · 6 comments

Comments

@asdadj
Copy link

asdadj commented Aug 20, 2023

No description provided.

@andreasbuhr
Copy link
Owner

Sorry, I don't understand what you mean. Could you elaborate please?

@vasdal
Copy link

vasdal commented Dec 1, 2023

Thinks this probably is the same error as i get:

include/cppcoro/detail/linux.hpp:22:13: error: expected identifier or '{'
[build]    22 |                 namespace linux
[build]       |                           ^
[build] <built-in>:447:15: note: expanded from macro 'linux'
[build]   447 | #define linux 1
[build]       |               ^
include/cppcoro/detail/linux.hpp:22:13: error: expected unqualified-id
[build] <built-in>:447:15: note: expanded from macro 'linux'
[build]   447 | #define linux 1
[build]       |               ^

@andreasbuhr
Copy link
Owner

What compiler are you using? It seems the compiler defines a macro named "linux". Do you find any documentation for that macro?

@andreasbuhr
Copy link
Owner

I do not find any compiler which defines "linux". It seems rather strange to me to do this, for a compiler.

@vasdal
Copy link

vasdal commented Dec 18, 2023

I'm currently building with:

Debian clang version 17.0.6 (++20231208085813+6009708b4367-1~exp1~20231208085906.81)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

Using this docker file:
Dockerfile.zip

@jorgen
Copy link

jorgen commented Dec 20, 2023

This happens if you are missing the C++ version. The linux macro is deprecated but included if you don't specify a C++ version:
https://godbolt.org/z/M3o1MMKv1

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