Giter VIP home page Giter VIP logo

Comments (12)

Toreno96 avatar Toreno96 commented on July 17, 2024 2

What about using -fsyntax-only flag? I tested it and the linter is working, saving header files doesn't generate anything anymore and the only disadvantage of this solution is the lack of any information about linker errors (but without -fsyntax-only flag linter isn't giving any details about the latters anyway, only "ld returned 1 exit status" error).

from linter-gcc.

hebaishi avatar hebaishi commented on July 17, 2024

Hello. I'm afraid this is unavoidable. When you run g++ -c headerfile.h, GCC compiles the header and generates headerfile.h.gch. I'm sorry but I haven't found a way of preventing g++ from generating these files. If you do, please feel free to re-open this issue. However, if you are hosting a C/C++ project on github, you can simply add *.gch to your .gitignore file to tell git to ignore these files.

from linter-gcc.

kioplato avatar kioplato commented on July 17, 2024

Hello, so the reason behind the creation of the headerfile.h.gch file is so atom can tell if there is an syntax error?

from linter-gcc.

hebaishi avatar hebaishi commented on July 17, 2024

I have just done some reading and it turns out there is a way to avoid actual compilation. The way to do this is by supplying the -gnats option to GCC. More info here

Edit: I've just tried using the -gnats option and it looks like it doesn't work.

from linter-gcc.

sneakypete81 avatar sneakypete81 commented on July 17, 2024

Is there a way of disabling linting on .h files? In some situations the spontaneous creation of .gch files is very unhelpful.

from linter-gcc.

hebaishi avatar hebaishi commented on July 17, 2024

Yes that's actually not a bad idea. I can add a regex field to generalise this so the user can choose to exclude files matching a certain pattern. What do you think?

from linter-gcc.

hebaishi avatar hebaishi commented on July 17, 2024

If that works, then you can simply add that to your flags. No need to add an extra option for header files.

from linter-gcc.

Toreno96 avatar Toreno96 commented on July 17, 2024

So, we have a solution :)

from linter-gcc.

hebaishi avatar hebaishi commented on July 17, 2024

I'll add a note in the README about this.

from linter-gcc.

sneakypete81 avatar sneakypete81 commented on July 17, 2024

@Toreno96: Thanks, that works nicely!

from linter-gcc.

eduherminio avatar eduherminio commented on July 17, 2024

Wow, thanks @Toreno96!

from linter-gcc.

evandgray avatar evandgray commented on July 17, 2024

Just a heads up, I know this is an old thread but I have found saving using "Save All" in the file menu or on MacOS CMD+OPTION/ALT+S works and avoids .gch files being made. This I believe, for whatever reason skips the linter on save and simply saves the file. I expect however if you are relying on syntax checking your file it may be skipped in this case.

from linter-gcc.

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.