I'm trying to use a clang-format file in CLion but CLion gives me the error:
Error reading [path to clang-format]: Invalid Argument
The error has to do with the RawStringFormats in my .clang-format file. When I remove the RawStringFormats section, CLion gives me no errors.
My .clang-format file is auto-generated by a script using Google's standards.
I need to find out the cause of the problem so I can modify the script to prevent this issue.
RawStringFormats:
- Delimiter: pb
Language: TextProto
BasedOnStyle: google
Delimiters is an array parameter, so
RawStringFormats:
- Language: TextProto
BasedOnStyle: Google
Delimiters: [pb]
CLion has a schema validator, and pb in your example is highlighted by yellow in editor. The tooltip shows the message:
Schema validation: incompatible types
Required: array. Actual: String
Related
I am running VS Code on Ubuntu 20.04 and code formatting doesn't seems to work for C/C++ although I have the necessary extensions installed. When I press "Ctrl+Alt+I" it says Formatting failed. See the output window for details.
Here is what the output window says.
Formatting failed:
/home/fmu/.vscode/extensions/ms-vscode.cpptools-1.7.1/bin/../LLVM/bin/clang-format -style=file -fallback-style=LLVM -assume-filename=/home/fmu/temp/coqoshv/src/core/vcpu-mgr/_new.c
/home/fmu/temp/coqoshv/src/core/.clang-format:49:1: error: unknown key 'CustomTernaryOps'
CustomTernaryOps: true # custom option for not breaking lines on ternary ops when possible
^~~~~~~~~~~~~~~~
Error reading /home/fmu/temp/coqoshv/src/core/.clang-format: Invalid argument
Can somebody help me on what could be the problem here. Thanks.
Check-in [llvm.org][1] which version of the formatter the option requires.
You can then manually run the formatter to see what version it is.
I had an issue where it didn't even post a message in the output window.
But by manually running the formatter located there: ~/.vscode/extensions/ms-vscode.cpptools-1.9.8-linux-x64/LLVM/bin/clang-format, I got messages pointing out that I had an options which was only usable for a greater version than the formatter supported.
Eclipse expert help needed! I have set up a makefile project to compile and link HCS12 code using the free codewarrior tools. It all seems to work well, but the only error/warning/information output I can get is to the console, with nothing being scanned from the console into the Problems window. I set up a regular expression error parser(Window -> Preferences -> C/C++ -> Build -> Settings -> Error Parsers) to scan the console for the appropriate information. If I search the console output (click in output and F) using find/replace with "regular expressions" checked, I find the warnings and errors--they just never get to the Problems tab.
I have enabled the error parser in (Project->Properties->C/C++ Build->Settings->ErrorParsers).
Somewhere I read that I need to enable this in C/C++ Makfile settings--but I cannot fine any settings which include the name "Makefile"; did I set up my project wrong??
Any suggestions or ideas on how to get my parsed errors into the problems window?
Eclipse Luna, Windows 7 professional.
It seems that the Regex parser for Eclipse (at least the older version I am currently using) assumes you start at the beginning of a line of text and end at the end of a line of text. My compiler errors were spanning multiple lines; I found a switch in the compiler which allowed it to output the errors in "microsoft format", which was then on a single line.
the new warning line looks like
.\CODE\LIBCODE\CodeLibraries\Drivers\CI2C1.C(312): WARNING C1801: Implicit parameter declaration for 'CI2C1_OnMasterBlockSent'
regex that works is now
[^"\n]\([^"(])((\d+)): WARNING C(\d+):([^\n]*)
of particular note is the [^"\n]*\ at the beginning of the regex expression, which matches all characters from the beginning of the line until the last \ is found--this is the piece I was missing. Eclipse Kepler is rather unforgiving about the regex it requires.
and we have
File $1 (just the file name--eclipse adds the path mysteriously if the file is in a code directory of the project)
Line $2 (gathers the line number of the error)
Descrioption $4 ( I ignore WARNING and the warning number, and capture the description of the error to the end of the line)
I now have a useful and somewhat more modern IDE to work with ancient code which grew from the assembly code over many years and was never parsed out into libraries or restructured into modern levels of abstraction.
I am trying to generate pdf from rmarkdown file using xelatex as latex engine. The file generates pdf while using pdflatex as latex engine. But, if I use xelatex, the file is giving the following error.
`! LaTeX Error: Option clash for package fontspec.
Error: LaTeX failed to compile cvGeneration.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See cvGeneration.log for more info.
Execution halted`
When I checked the log file I got the following few lines only.
*`! LaTeX Error: Option clash for package fontspec.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...
l.65 ...Package[\eu#zf#math]{fontspec}[2008/08/09]
The package fontspec has already been loaded with options:
[]
There has now been an attempt to load it with options
[no-math]
Adding the global options:
,no-math
to your \documentclass declaration may fix this.
Try typing to proceed.`*
Can anyone tell me why this problem is generating particularly for xelatex? I am trying to implement xelatex, since it supports UTF-8 character.
Thanks In advance.
My YAML header is given below:
params:
cvName: RJ MIMI
name: "`r params$cvName`"
address:
www:
phone:
email:
linkedin:
headcolor: "00008B"
date: "`r format(Sys.time(), '%B')`"
output:
vitae::hyndman:
keep_tex: true
latex_engine: xelatex
header_includes:
- \ExecuteBibliographyOptions{useprefix=true}
- renewcommand{\bibfont}{\normalfont\fontsize{10}{12.4}\sffamily}
This is pretty far down the road, however, the easiest way to get past the fontspec error is to set defaultfontfeatures. (fontspec is the default in RMarkdown.)
I don't have all that is going into your code here, update your header_includes to:
header_includes:
- \ExecuteBibliographyOptions{useprefix=true}
- \defaultfontfeatures(Ligatures = TeX)
- renewcommand{\bibfont}{\normalfont\fontsize{10}{12.4}\sffamily}
This may still give you warnings because it's not right, but it works.
I want to use clang convert Object - C to C + +, quoted error is as follows:
userdeMac-mini:Demo xxx$ clang -rewrite-objc main.m
main.m:9:9: fatal error: 'UIKit/UIKit.h' file not found
import <#UIKit/UIKit.h>
1 error generated.
Excuse me, how should solve ?
This works for me. You can try by changing the path according to your SDK location.
clang -x objective-c -rewrite-objc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk ViewController.m
main.m:9:9: fatal error: 'UIKit/UIKit.h' file not found
That means that the UIKit headers can't be found. Do you have the iOS SDK installed somewhere? Have you configured the search paths in your makefile (or build environment) correctly?
The easiest way to start investigation is to start with a working Xcode project, compile a single .m file, and then see the command line that was used to compile that file. The clang rewriter takes slightly different options, but the search paths and a lot of the other configuration are the same.
First of all, you should use the "cd" command to enter to "clang - rewrite - objc" file directory, then use a command such as "clang - x objective - c - rewrite - objc - isysroot/Applications/Xcode. The app/Contents/Developer/Platforms/iPhoneSimulator platform/Developer/SDKs/iPhoneSimulatorX X.s dk X.m", the "X" is the version of your iPhoneSimulator and "clang - rewrite - objc" file name.
I'm trying to build qtCreator 2.3 with gcc 4.7 and I'm getting following error:
error: unable to find string literal operator ""
I'm using mingw32-make -lto as qtCreator source dir. Any thoughts?
Just Googled this and saw the following comment on this page
The subject error occurs because in the new c++11 a space between string concatenation is mandatory
It may be related to what you're seeing.