Giter VIP home page Giter VIP logo

Comments (16)

hebaishi avatar hebaishi commented on August 16, 2024 4

I think you might need to add -fsyntax-only to your C/C++ flags. That should prevent the generation of object files but still do syntax checking. Could you repeat the steps above, but with -fsyntax-only in your C/C++ flags?

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024 4

I just had an idea!!!! Try adding this option: -o /dev/null. This will tell GCC to write the object file to /dev/null, which means it will simply get thrown away!

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

Hello. Could you open the developer console (by pressing Ctrl+Shift+I), copy the linter-gcc command, and paste it here?

from linter-gcc.

Arignir avatar Arignir commented on August 16, 2024

Here it is :

linter-gcc: /usr/bin/gcc -W -Wall -Wextra -pedantic -std=c++11 -c -fmax-errors=0 -I/home/grange_c/vox/include/ -I/home/grange_c/vox/include/lib/ -I/home/grange_c/vox/include/class/ -I/home/include/ -I/home/grange_c/include/ /home/grange_c/vox/src/main.cpp

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

Ok. Could you try the following:

  1. Close Atom
  2. Delete the *.o files
  3. Edit your C/C++ compile flags so that -c is right at the start
  4. Use linter-gcc normally, and see if any new *.o files are generated.

from linter-gcc.

Arignir avatar Arignir commented on August 16, 2024

Hi !

I tried the 4 steps, and yeah it's still making *.o files.

linter-gcc: /usr/bin/gcc -c -W -Wall -Wextra -pedantic -std=c++11 -fmax-errors=0 -I/home/grange_c/.froot/include/ -I/home/grange_c/vox/include/ -I/home/grange_c/vox/include/lib/ -I/home/grange_c/vox/include/class/ /home/grange_c/vox/src/main.cpp

By the way, i think the *.o files are generated only when i'm saving a *.cpp file without any GCC error.

Thanks for the help !

from linter-gcc.

Arignir avatar Arignir commented on August 16, 2024

Yeah it's wokring like that, but i don't like -fsyntax-only, it's adding useless errors while working with libraries like opengl. >_>

But it's working fine, thanks !

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

You say there are useless errors when working with opengl. I assume these are to do with certain functions being undefined. Is that correct? In that case you could simply link against the opengl library (with an option like -lgl or something like that). But then again if you link you might get errors saying your main is undefined (if linting a source file that doesn't contain a main function).

from linter-gcc.

Arignir avatar Arignir commented on August 16, 2024

Brilliant ! It works fine !

Would be great if it was enable by default ^_^

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

Yes I will add it to the default flags, and to the README in the next version.

from linter-gcc.

Ehekatl avatar Ehekatl commented on August 16, 2024

@hebaishi -o /dev/null not working on windows with gcc 5.3.0, and solution for this ? It's generating .o files everywhere for every atom projects I open...

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

I believe the default null device on Windows is NUL. So try -o NUL.

from linter-gcc.

hebaishi avatar hebaishi commented on August 16, 2024

@Ehekatl everything working for you?

from linter-gcc.

Ehekatl avatar Ehekatl commented on August 16, 2024

@hebaishi work like a charm, many thanks : )

from linter-gcc.

HeaTx avatar HeaTx commented on August 16, 2024

I have the same issue and both, -fsyntax-only and -o /dev/null worked for me (deleting it make a .o file instantly).
But I have a doubt about if -fsyntax-only could generate conflict with -Wall making it useless.
Can someone explain?

Thanks for the help ;)

from linter-gcc.

mkst avatar mkst commented on August 16, 2024

I have the same issue and both, -fsyntax-only and -o /dev/null worked for me (deleting it make a .o file instantly).
But I have a doubt about if -fsyntax-only could generate conflict with -Wall making it useless.
Can someone explain?

Thanks for the help ;)

I'd suggest you don't need the -fsyntax-only if you're just discarding output with -o /dev/null...

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.