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

unclear include order in C headers #771

Open
nnrepos opened this issue Apr 30, 2023 · 0 comments
Open

unclear include order in C headers #771

nnrepos opened this issue Apr 30, 2023 · 0 comments

Comments

@nnrepos
Copy link

nnrepos commented Apr 30, 2023

C system headers (more precisely: headers in angle brackets with the .h extension), e.g., <unistd.h>, <stdlib.h>.
the clarification actually makes things worse - any file can be included via angle brackets, all they do is tell the compiler to search in some predefined path, rather than the local directory.

if i have the following files:

root/
  hello.h
  nice/
    bye.h

then, within root/nice/bye.h, the order of the following lines is not clear:

// bye.h copyright: me.

#include <unistd.h>
#include <../hello.h>
#include <map>

on one hand, hello.h is within angle brackets. on the other hand, it's another library's / my project's .h file.

please help :)

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