Giter VIP home page Giter VIP logo

Comments (6)

MaskRay avatar MaskRay commented on July 29, 2024

warning: argument unused during compilation: '-Wall'

The command line used in compile_commands.json will be more helpful.

https://github.com/MaskRay/ccls/wiki/FAQ#diagnostics-in-headers

from emacs-ccls.

dlyr avatar dlyr commented on July 29, 2024
{
  "directory": "/MY_BUILD_DIR/src",
  "command": "/usr/bin/c++  -DIO_USE_ASSIMP -DIO_USE_CAMERA_LOADER -DIO_USE_TINYPLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DRA_ENGINE_EXPORTS -DradiumEngine_EXPORTS -I/MY_BUILD_DIR/src -I/MY_PROJECT_DIR/src -I/MY_PROJECT_DIR/Bundle-GNU/3rdPartyLibraries/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++  -Wall -Wextra  -pthread -msse3 -Wno-sign-compare -Wno-unused-parameter                  -D_DEBUG -DCORE_DEBUG -g3 -ggdb          -g -fPIC   -Wno-ignored-attributes -Wno-misleading-indentation -Wno-unknown-pragmas -fPIC -std=c++17 -o CMakeFiles/radiumEngine.dir/Engine/Component/Component.cpp.o -c /MY_PROJECT_DIR/src/Engine/Component/Component.cpp",
  "file": "/MY_PROJECT_DIR/src/Engine/Component/Component.cpp"
},

I just notice I also get some Error from the Language Server: failed to index MY_SOURCE_FILE (Internal Error)

from emacs-ccls.

dlyr avatar dlyr commented on July 29, 2024

Any suggestions ? I read the FAQ but it do not help me so much.
At least how can I get "simple" syntax highlighting (now everything is fontified like comments)

Seems like a header is included two time, the #define guard make the header as not to be defined (and so fontify like comments).

from emacs-ccls.

MaskRay avatar MaskRay commented on July 29, 2024

warning: argument unused during compilation: '-Wall'

The problem is that you have some flags changing the compilation mode in a way that these flags are all considered unused. I recommend starting from no flags and gradually adding them.

I just notice I also get some Error from the Language Server: failed to index MY_SOURCE_FILE (Internal Error)

When a file fails to parse, there is no index information and you'll see such error message.

from emacs-ccls.

dlyr avatar dlyr commented on July 29, 2024

Here is a minimal example. The thing is that if compile command have a -DDEBUG that is #undef then #define it produce a ccls warning. I dunno if it's correct or not, but seems strange for me.

exemple.zip

from emacs-ccls.

MaskRay avatar MaskRay commented on July 29, 2024

warning: argument unused during compilation: '-Wall'

I believe you have misconfigured something.
Change you wrapper script to: ccls -log-file=/tmp/ccls.log -v=1 "$@" -v=1 will give you the command line used to parse files, e.g.

12:11:34 indexer2         pipeline.cc:310 I parse /tmp/Downloads/ex/main.cpp
  /usr/bin/c++ -DDEBUG -std=c++17 -o out.o -c /tmp/Downloads/ex/main.cpp  -working-directory=/tmp/Downloads/ex

exemple.zip

This example works fine for me.

If you have some non self-contained header files, the PR just gets merged may help you MaskRay/ccls#171

e.g. .ccls:

%compile_commands.json
%h -DH

from emacs-ccls.

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.