YouCompleteMe not seeing language version flags

RESOLVED FIXED in Firefox 50

Status

enhancement
RESOLVED FIXED
3 years ago
Last year

People

(Reporter: rillian, Assigned: Ehsan)

Tracking

unspecified
mozilla50

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Today I noticed Ycm was marking up C++11-only features in my source files, like the `auto` keyword and `F foo = {a, b, c}` struct initializers.

We generally build with `-std=gnu++11` but it looks like .ycm_extra_conf.py isn't getting this flag from mach.
Posted patch Workaround (obsolete) — Splinter Review
Here's a work-around patch, just forcing the flag unconditionally. Presumedly this breaks Ycm on non-C++ source files.

Ehsan, and idea what's going on here?
Attachment #8764789 - Flags: feedback?(ehsan)
So sorry for the long delay here, I was on vacation/sick...

So the way that this works is .ycm_extra_conf.py calls |./mach compileflags path/to/file.cpp| which in turn runs |make -C objdir/path/to showbuild|.  Running the showbuild target manually, I get:

                  CC =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang -std=gnu99
                 CXX =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang++ -std=gnu++11
                 CCC =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang++ -std=gnu++11
                 CPP = /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang -std=gnu99 -E
...

Note how the -std flags are specified in CXX and not CXXFLAGS!
Assignee: nobody → ehsan
Comment on attachment 8764789 [details] [diff] [review]
Workaround

My patch fixes this more properly.
Attachment #8764789 - Attachment is obsolete: true
Attachment #8764789 - Flags: feedback?(ehsan)
Attachment #8774812 - Flags: review?(gps) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0a1c5b06f3da
Include the flags passed through CC/CXX in ./mach compileflags; r=gps
https://hg.mozilla.org/mozilla-central/rev/0a1c5b06f3da
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Thanks ehsan!
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.