FidoProject/Fido

Use of angle brackets around file names for include statements

elfring opened this issue · 20 comments

@elfring Doesn't that mean that the library would have to be globally installed for it to build and run properly? Or would the include folder have to be marked as an include path by g++? Either way, what is the advantage over the double quotes?

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
…

@FlyingGraysons @joshuagruenstein and I are a little unsure of what you are saying. Could you please clarify, @elfring?

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"?

I believe that:

  • If double quotes are used, only the local and include directories are searched
  • If brackets are used, the system and include directories are search are search

I doubt that there is a measurable speed difference between the two methods.

I may be wrong though.

Can you imagine use cases where you would like to exclude the search in "local" directories?

I cannot

@elfring Can you think of any use cases?

Yes. - This is the reason for my feature request here.

How much do you care where the include files are safely stored for a software library?

@elfring What is the case?

I find it important to be reasonably sure that the desired computations were really correct because it could be determined by the applied software build parameters that the used functions were actually derived from the expected source files. Can you follow this design concern?

What do you mean by this: "the desired computations were really correct"?

I would generally prefer to exclude the potential for the inclusion of header files from unexpected directories. Can such a security detail become a bit more important occasionally?

Yes, but the brackets mean that a person would have to specify an include directory, which is slightly annoying.

Will the mentioned "annoyance" vanish after safe include specifications would be used?

Yes. This does sound like a good idea. Thank you for the feature request.

Would specifying the include directory in our g++ compilation command in our makefiles and switching the the brackets fix your specified problem?

How would you like to distinguish library versions by your software build system?

Not sure? Any suggestions?

Feel free to submit a pull request that fixes the problem @elfring