GithubHelp home page GithubHelp logo

Comments (5)

charliegracie avatar charliegracie commented on August 25, 2024

Currently the Eclipse OMR project uses <> for system include files and "" for our project header files. I believe we are not violating any spec with this usage pattern but if there is a best practice we could be following that is something we would consider. Do you have any more details?

from omr.

elfring avatar elfring commented on August 25, 2024

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
…

from omr.

mstoodle avatar mstoodle commented on August 25, 2024

Boiling that down: the point would be to avoid searching the "current directory" for our headers by using angle brackets rather than the quoted form? Given the fuzziness of the notion of the "current" directory when compiling, I can sort of see the argument. But I also think most people would find the change odd.

Anyone feel strongly we should go down this path? Otherwise I vote we keep it as is at least for now; we've managed to go 20+ years without running into problems with the current directory on the search path...

from omr.

elfring avatar elfring commented on August 25, 2024

Given the fuzziness of the notion of the "current" directory when compiling, I can sort of see the argument.

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?

from omr.

mstoodle avatar mstoodle commented on August 25, 2024

Angela pointed out that the same standard specification for C++ programming you pulled text from also contains the following recommendation (point 7 on page 403):

[ Note: Although an implementation may provide a mechanism for making arbitrary source files available to the < > search, in general programmers should use the < > form for headers provided with the implementa- tion, and the " " form for sources outside the control of the implementation. For instance:

     #include <stdio.h>
     #include <unistd.h>
     #include "usefullib.h"
     #include "myprog.h"

— end note ]

OMR makefiles assume they're being run in the current directory and would break for a number of reasons if they weren't being run there.

The security argument feels pretty weak to me: any security risk would come from someone with access to the platform to rebuild OMR / language runtime and they could just as easily modify the makefile to include whatever directory they want on the include path. Security details are definitely important, but I don't see this recommendation providing any real security improvement.

In summary, using angle brackets on OMR header includes would seem to serve no purpose other than to specifically go against the general recommendation Angela pointed out above, which virtually every C/C++ programmer is used to.

I think we should keep things as they are.

from omr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.