I'm using VSCode for writing C code. I can see the squigly lines (red) in errors (which are shown in the Problems tab) normaly. However warings are squigly lines are not shown and the warnings themselves are not shown in the Problems tab. How to eneable warnings and warnings squigly lines?
I have tried to find specific settings or commands, but could not find any solution yet. It would be good to check every warning, since, for my application, some of them are actually very important.
Related
I can see my code being executed in the terminal window but the output screen does not pop up when I hit run . The output window on the console shows running and then done but the black screen with the result does not pop up like it used to before.I might have changed some settings in vscode but now I can't find the right one to change.
There can be many reasons. I'm afraid the changes you've applied caused this but no worries I suggest going over your project settings and VSCode's settings.
Check out these two links:
VS Code settings
C / CPP Config
P.S. I'm suggesting the second link based on your C tag.
Check your debug window too:
Menu -> Debug Console
or
Ctrl+Shift+Y.
I am using Delphi 2007. I know how to get the IDE compiler to suppress/ignore particular warnings.
But how do I get the command line compiler to do this ?
You use the -W-[WARNING] option. The following example turns off W1036 ("Variable %s might not have been initialized"):
dcc32 test.dpr -W-USE_BEFORE_DEF
The only way I've found to find out the warning name to use is to create a simple console project in the IDE, add code that will produce the warning you want to identify, and then set the Project->Options-Compiler-Hints and Warnings to suppress that warning. Then build your project. Show the Messages window, go to the Output tab, Ctrl+A to Select all, Ctrl+C to copy.
Create a new console app.
program Test1;
{$APPTYPE CONSOLE}
uses
SysUtils;
begin
WriteLn('Test1');
ReadLn;
end.
Use Project->Options->Compiler`->Hints and Warnings, and turn off the warning(s) you want to suppress.
Build your test project.
In the Output tab of the Messages window, select all (Ctrl+A or using the context menu) and copy to the clipboard (Ctrl+C or via the context menu).
In a new Notepad window (or a new editor tab), paste in the contents of the clipboard. You'll find a long block of dcc32.exe command line similar (but probably much longer) than this (I've emphasized the relevant parts to notice):
Build started 02/05/2016 2:48:48 PM.
Project "E:\Code\Project1.dproj" (Make target(s)):
Target CoreCompile:
c:\rad studio\5.0\bin\dcc32.exe -DDEBUG;DEBUG -I"c:\rad studio\5.0\lib";"c:\rad studio\5.0\Imports";"C:\Users\Public\Documents\RAD Studio\5.0\Dcp";E:\Code\FastMM4;E:\madCollection\madBasic\BDS4;E:\madCollection\madDisAsm\BDS4;E:\madCollection\madExcept\BDS4;"E:\Code\Virtual Treeview\Source";E:\code\Indy10_5294\Lib\Core;E:\code\Indy10_5294\Lib\System;E:\code\Indy10_5294\Lib\Protocols;
--SNIPPED ANOTHER DOZEN LINES-- --no-config -W-USE_BEFORE_DEF Project1.dpr
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.12
So as a result of all this, we've identified USE_BEFORE_DEF as the warning name for W1036 for use with the command line compiler, as well as illustrated exactly how to supply it to the compiler.
You can, of course, disable more than one warning in order to identify them; I've just used one for simplicity, and snipped out a lot of the command-line output that is produced.
I'm trying to get used to Emacs, I'm coding in C for my school. So, I installed flycheck to check for potential compliation errors. However, I encounter several problems. Here's the message I get when I test flycheck with the c/c++-gcc checker : flycheck buffer
I have two issues there : - first, flycheck claims the checker "returned a 1 exit code without errors" depsite the fact it actually did, and it's even displaying it right after ! - secondly, it does not seem to be able to display quotes correctly, the only thing displayed are their unicode escape sequences.
I can't find out why those issues are present. Can anybody help me on this ?
fixed both my problems by setting my environment language to UTF-8.
I am using emacs on Windows 7 and am using c-mode. Indentation starts out fine, but frequently, it stops working fine (what happens is that when I press the tab key, instead of indenting to where it normally would if things worked correctly, it would get rid of all indentation on that line). I have found that re-activating c-mode made everything work nicely again.
This happens anywhere in the code. If I have existing code and tab (even in the first lines of a main function), it will remove all indentation. I am almost 100% sure it isn't because I failed with my syntax somewhere. For example, if I have the following code, pressing "tab" on the second line will remove all indentation.
int main() {
printf("Foo\r\n");
return 0;
}
I don't believe c-mode suddenly disables (all of the syntax highlighting still exists, and the "C/l Abbrev" is still there on the bottom of the window). Any insights would be appreciated.
Most likely, you're hitting a bug in CC-mode, which results in a messed-up parse-state cache. The best thing you can do: M-x report-emacs-bug and try to come up with a reproducible test case. You can also try to upgrade to the latest Emacs (I know that the upcoming 24.4 has bug-fixes in that area, as did previous releases).
I'm writing C code and was initially using the gcc checker. Errors were reported in the C file. Lots of errors that didn't matter were being reported due to, for instance, no include directory switches on the gcc command line in the checker. Because we're using icc and it feels unwieldy to setup all of the parameters that are already setup in our makefile, I decided to switch over to using the make checker.
Upon switching to the make checker, I did not get any results. Looking at the makeprg command in make.vim, it is make -sk. I realized that our makefile was not setup to do syntax checking, so I created a new target called syntax_check that added the -fsyntax-only and -c flags. I then changed the make.vim makeprg command to make -sk clean syntax-check so that the appropriate target is run.
When I save the file I watched top in another window and saw that the build is occuring. However, I'm still getting no errors. By this, I mean I don't see the green sidebar indicating lines that did not have errors. Running :Errors does not bring up the location list.
Any ideas? And is my understanding of how to look at the generated errors in syntastic wrong (which it may very well be)?
As a side note for the question here, I've also got this question in on the Syntastic github page here.
It turns out that the errorformat was wrong for handling icc. This, of course, makes total sense.
The errorformat for icc that I've got so far is:
let errorformat = '%W%f(%l): %tarning #%n: %m,%E%f(%l): %trror: %m'
I will add more to this as I find errors that aren't covered by this format or find that I need different formatting.