User forums > Using Code::Blocks

Inaccurate error / warning counts reported for VC++2015

<< < (2/2)

sodev:
There is no need to edit the CodeBlocks source to get VS2015 working, everything can be done with adding settings. Only if you want to add VS2015 "nicely" so that it can auto-detect the paths and gets a nicer name it requires code changes, otherwise you can just create a copy from the VS2010 compiler and make the changes yourself.

Lets start with your main issue, the error parser. All these settings go into Settings -> Compiler -> Global compiler settings | [your selected compiler] | Tab Other Settings -> Advanced Options | Tab Output parsing. You need do add some entries to the Parsing expressions list, order DOES MATTER.

Add the following entries AT START of the list to grab the new info messages:

--- Code: ---Description: Compiler info
Type: Info
Regular expression: ([][{}() \t#%$!~[:alnum:]&_:+/\.-]+)\(([0-9]+)\)[ \t]*:[ \t]([Nn]ote:[ \t].*)
Sub-expression indices:
Message: 3
Additional message 2: 0
Additional message 3: 0
Filename: 1
Line: 2

Description: Compiler info no line
Type: Info
Regular expression: ([][{}() \t#%$!~[:alnum:]&_:+/\.-]+)[ \t]*:[ \t]([Nn]ote:[ \t].*)
Sub-expression indices:
Message: 2
Additional message 2: 0
Additional message 3: 0
Filename: 1
Line: 0

--- End code ---

Modify the regular expression of the following two already present entries:

--- Code: ---Parsing Expression "Compiler warning":
Regular expression: ([][{}() \t#%$!~[:alnum:]&_:+/\.-]+)\(([0-9]+)\)[ \t]*:[ \t]([Ww]arning[ \t].*)

Parsing Expression "Compiler error":
Regular expression: ([][{}() \t#%$!~[:alnum:]&_:+/\.-]+)\(([0-9]+)\)[ \t]*:[ \t](.*[Ee]rror[ \t].*)

--- End code ---

To detect the new warning messages without line add the following entry directly below "Compiler warning":

--- Code: ---Description: Compiler warning no line
Type: Warning
Regular expression: ([][{}() \t#%$!~[:alnum:]&_:+/\.-]+)[ \t]*:[ \t]([Ww]arning[ \t].*)
Sub-expression indices:
Message: 2
Additional message 2: 0
Additional message 3: 0
Filename: 1
Line: 0

--- End code ---

Bonus: If you are also using mt.exe in Post-Commands to embed the Manifest into the EXE and want to catch its errors because stupid Windows 10 again blocked write access to the file or whatever, you can add the following entry at the end of the list:

--- Code: ---Description: Manifest error
Type: Error
Regular expression: mt.exe[ \t]*:[ \t]*(.*)
Sub-expression indices:
Message: 1
Additional message 2: 0
Additional message 3: 0
Filename: 0
Line: 0

--- End code ---

These entries should catch all notes/warnings/errors VS2015 produces, it might miss some linker errors, im getting these only rarely so i don't know if there are any that don't work with the old expressions.

But to sucessfully compile i think your are missing some directories in your search paths, for the compiler you should also need

--- Code: ---C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt

--- End code ---
and for the linker

--- Code: ---C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86

--- End code ---
Directory names might differ in the version and architecture part.

@oBFusCATed: Sorry but i don't know where these settings are done in code and don't have time atm to look for that

oBFusCATed:

--- Quote from: sodev on April 10, 2017, 09:00:20 pm ---@oBFusCATed: Sorry but i don't know where these settings are done in code and don't have time atm to look for that

--- End quote ---
I think all these are stored in xml files and not in the code. So if you can try to find them and provide a patch against these xml files it will be really helpful.

aaron_baker:
Hello!

Thanks for the help, I've almost got it, I'm just having a slight issue. I can't seem to order the regular expressions correctly. I tried to insert the info ones before compiler warning, but they still appeared at the bottom, below the linker expressions. I can't figure out how to move them up, either. Any help would be appreciated.

Best,
Aaron

sodev:
While making the patch i discovered some small errors in my expressions, i fixed them in my previous post.

There are these two buttons at the right side of the list, select an entry and move it around with the buttons.

These settings are indeed all in one xml file, it gets used for all MSVC compilers. Since my expressions still match the old format as well there is no harm done changing them, the added expressions simply wont do anything with the old compilers. However i got some strange results using the updated CodeBlocks with my old configuration (duplicate entries what wont go away), resetting all entries to default solved it though. You can find the patch here: https://sourceforge.net/p/codeblocks/tickets/496/

Navigation

[0] Message Index

[*] Previous page

Go to full version