Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Disable code analysis on a per file basis?
Disable code analysis on a per file basis? [message #734842] Mon, 10 October 2011 07:08 Go to next message
Gonzague Reydet is currently offline Gonzague ReydetFriend
Messages: 3
Registered: July 2009
Junior Member
Hi all!

I am trying to disable the code analysis tool on a per file basis.

I found two different ways to ignore files for the "Run C/C++ code analysis" context menu operation.
In the build configuration, we can either exclude files to be ignored from build or we can add the to the code analysis rules' exclusion pattern.

But in both case if the user opens an ignored file, the code analysis is performed anyway at file opening. Is there a way to avoid performing this code analysis when opening an editor on a file that should be ignored by the code analysis tool?
Is it a bug?

Thanks for any help

[Updated on: Mon, 10 October 2011 07:09]

Report message to a moderator

Re: Disable code analysis on a per file basis? [message #926525 is a reply to message #734842] Fri, 28 September 2012 18:44 Go to previous messageGo to next message
John Stile is currently offline John StileFriend
Messages: 20
Registered: July 2009
Junior Member
I am trying to do the same thing in Eclipse-4.2, with CDT-8.1.

I want Code Analysis to ignore files with a specific extension (.m4).

Has anyone done this?
Re: Disable code analysis on a per file basis? [message #930907 is a reply to message #734842] Tue, 02 October 2012 18:54 Go to previous messageGo to next message
John Stile is currently offline John StileFriend
Messages: 20
Registered: July 2009
Junior Member
Could this be due to the editor used to open the file?
If you chose "Open With" -> "Text Editor", does the Code Analysis still run on the file?
Re: Disable code analysis on a per file basis? [message #931533 is a reply to message #930907] Wed, 03 October 2012 09:39 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
Hello,

as far as I know Code Analysis uses the same file types as CDT.

So you could try this:
Open "Windows -> Preferences -> C/C++ -> File Types"
and remove the *.m4" from the list of the files types.

Open "Windows -> Preferences -> General -> Editors -> File Association"
and add a new file type *.m4 to this list and associate the file type to your preferred editor, probably C/C++ Editor.

Maybe you must trigger a index rebuild after changing the setting.


If that does not work for you you probably could use this method:

Open "Windows -> Preferences -> C/C++ -> Code Analysis"
Here you can customize each checker to exclude or include specific files.
http://wiki.eclipse.org/CDT/User/NewIn80#Scope_filters

A short feedback which one of this version work for you is welcome.

regards,
Klaus




Re: Disable code analysis on a per file basis? [message #934107 is a reply to message #931533] Fri, 05 October 2012 16:59 Go to previous message
John Stile is currently offline John StileFriend
Messages: 20
Registered: July 2009
Junior Member
Open "Windows -> Preferences -> C/C++ -> File Types"
and remove the *.m4" from the list of the files types.


.m4 is not listed.

Open "Windows -> Preferences -> General -> Editors -> File Association"
and add a new file type *.m4 to this list and associate the file type to your preferred editor, probably C/C++ Editor.


.m4 already exists, associated with "Autoconf Editor (default)".

Changing to /C++ Editor and reopening the file, I don't see the errors any longer.

No need to re-index (Right click Project->Index->Rebuild)

Perfect. Thank you.
Previous Topic:Another problem with Hello World project
Next Topic:Indexer syntax error false positive
Goto Forum:
  


Current Time: Wed Nov 13 15:29:48 GMT 2024

Powered by FUDForum. Page generated in 0.03141 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top