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 of angle brackets around file names for include statements #2838

Closed
elfring opened this issue Aug 6, 2018 · 14 comments
Closed

Use of angle brackets around file names for include statements #2838

elfring opened this issue Aug 6, 2018 · 14 comments
Labels

Comments

@elfring
Copy link
Contributor

elfring commented Aug 6, 2018

Would you like to replace any double quotes by angle brackets around file names for include statements?

@bagder
Copy link
Member

bagder commented Aug 6, 2018

Why? We use double quotes for local include files, why should we not?

@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

I suggest to reconsider the consequences of the following wording from the section “16.2 Source file inclusion” in the standard specification for the programming language “C++”.

…
The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read

#include <h-char-sequence> new-line
…

@bagder
Copy link
Member

bagder commented Aug 6, 2018

This is not C++.

This code has been built on a huge amount of platforms and operating systems already. Do you have a specific problem you want to address?

How do you think about to avoid “a duplicated file search” here?

I don't understand what that refers to.

Would you like to restrict the searched directories for header files of your software?

I don't understand what this refers to either. Again: when we want to include a local header file, why should we not check for it in the local directory first?

@bagder bagder added the build label Aug 6, 2018
@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

  • How do you think about to avoid potential confusion around the wording “local (or current) directory”?
  • Do you expect that (header) files for such a software library will be used from a storage location where they were installed?

There are different opinions about the handling of the involved implementation-defined behaviour.

  • Will header files be also searched outside the specified include directories if double quotes are used for the discussed preprocessor statement?
  • Is there a speed difference measurable if a file is not found there and the search will be retried with “the angle brackets inclusion method”?

@bagder
Copy link
Member

bagder commented Aug 6, 2018

This is an issue tracker.

Do you have a specific problem with the include files?

@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

I am trying to achieve that the needed files are actually retrieved from trusted directories according to preferred software build parameters.
How much will the selected file inclusion style matter then?

@bagder
Copy link
Member

bagder commented Aug 6, 2018

I am trying to achieve that the needed files are actually retrieved from trusted directories

Are you building curl/libcurl with something else than one of the shipped build mathods and this method has a problem with C source files using include files within double quotes? What method/compiler/setup is this?

@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

I suggest to take another look at the following difference.

…
#include <curl/curl.h>
…
#include "curl_sspi.h"
…

@bagder
Copy link
Member

bagder commented Aug 6, 2018

I suggest to take another look at the following difference.

I looked. I see no problem. Do you?

@jzakrzewski
Copy link
Contributor

@bagder I don't get this guy. He opens basically the same issues in various repositories. Everyone tells him "no" for more or less the same reasons you have stated and he just keeps going. The argumentation is basically a copy-paste.

The conclusion from one of the threads ( json-c/json-c#440 ) was that he's a carbon-based bot ;)

@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

  • From which storage location should a library file be picked up preferably?
    • Known installation directory
    • Random (or temporary) software development status
  • Do inclusion specifications for files like “curl.h” and “curl_sspi.h” refer to the same library version?

@bagder
Copy link
Member

bagder commented Aug 6, 2018

"curl.h” should never be included. We suggest <curl/curl.h> for applications since the header is supposed to be included from the system include path.

curl_sspi.h is a private header file that only libcurl uses when you build it, which is why it is included with double quotes. This is never included by applications.

@elfring
Copy link
Contributor Author

elfring commented Aug 6, 2018

We suggest <curl/curl.h> for applications since the header is supposed to be included from the system include path.

Can this expectation fit to any more inclusion specifications of other software components?

curl_sspi.h is a private header file that only libcurl uses when you build it, which is why it is included with double quotes.

How “private” is such a header file during the mentioned software build process?

This is never included by applications.

Would you like to increase the distinction for the safe reuse of software components there and at other stages of programming?

@bagder
Copy link
Member

bagder commented Aug 6, 2018

Can this expectation fit to any more inclusion specifications of other software components?

Other libraries have their headers and defined use.

How “private” is such a header file during the mentioned software build process?

Entirely private.

Would you like to increase the distinction for the safe reuse of software components there and at other stages of programming?

What are you talking about?

I now conclude that you do not experience an issue with the include files, and therefore I close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants