User forums > Using Code::Blocks
Build messages settings and Find/Replace tool
Joshua Flynn:
I've got two questions for code::blocks I need help with.
1):
Normally, for code::blocks, when I click on build error messages, it jumps to the line of which the error is on. For some reason, however, this is disabled for me - what settings do I have to modify in order to re-enable it?
2):
When using the Find and/or Replace feature, I have trouble optimising the search such that it doesn't bring up false positives (I'm working with 10+ files), for example:
Say I want to replace the return variable of numerous differently name functions, such that:
bool ReturnBool()
bool SomeOtherFunction()
become:
const bool ReturnBool()
const bool SomeOtherFunction()
You would search for 'bool' and replace it with 'const bool'. But my problem is, there already exist instances of 'const bool', of which it picks up, and there are also booleans which are variables (and not function returns) - and there a lot of instances of pre-existing 'const bools', so for example:
bool ReturnBool()
const bool ReturnConstBool()
const bool ReturnConstBool(const bool IsAcceptable)
bool Toggle;
would become:
const bool ReturnBool()
const const bool ReturnConstBool()
const const bool ReturnConstBool(const const bool IsAcceptable)
const bool Toggle; //This is now read only. Which is bad.
Just to add: Whilst it would be an idea to say to manually sift through the code, there are 10+ pages of code to sift through, and this process gets extremely tedious given there are a lot of const bool returning functions. The bool to const bool is a standardising process to check for any functions not compliant - but it catches all the functions that are already compliant.
Is there any way that I could somehow:
1) Specify a 'but not' instance, so for example:
Search for all:
bool
But not:
const bool
Replace with:
const bool
2) Make it avoid replacing instances of pre-existing const bools?
3) Make it avoid variables?
I imagine this isn't likely to get an answer, but would it be worth considering implementing a 'but not' feature?
oBFusCATed:
1) we need more details here
2) you can use regular expression to help you minimize the false positives, but they don't know if a match is a function definition/declaration, variable or call to a function.
Joshua Flynn:
--- Quote from: oBFusCATed on August 31, 2011, 10:00:57 am ---1) we need more details here
2) you can use regular expression to help you minimize the false positives, but they don't know if a match is a function definition/declaration, variable or call to a function.
--- End quote ---
1) Basically, when you compile a program, if there are any warnings or errors, they are reported in the build messages/build log. Normally, when you click (or double-click) on the messages, it takes you to the line in the code where the error occurred (which is extremely useful in a large code base), but for some reason, it no longer jumps to the specific lines. So I am wondering how I would re-enable this, as it somehow got disabled.
2) What are valid regular expressions, and how do I use them? Anything that helps reduce false positives is appreciated.
Thank you.
Jenna:
--- Quote from: Joshua Flynn on August 31, 2011, 10:06:07 am ---
--- Quote from: oBFusCATed on August 31, 2011, 10:00:57 am ---1) we need more details here
2) you can use regular expression to help you minimize the false positives, but they don't know if a match is a function definition/declaration, variable or call to a function.
--- End quote ---
1) Basically, when you compile a program, if there are any warnings or errors, they are reported in the build messages/build log. Normally, when you click (or double-click) on the messages, it takes you to the line in the code where the error occurred (which is extremely useful in a large code base), but for some reason, it no longer jumps to the specific lines. So I am wondering how I would re-enable this, as it somehow got disabled.
--- End quote ---
Can you post a snippet of the content of the "Build log" and the "Build messages" with an error messages that does not work ?
Joshua Flynn:
--- Quote from: jens on August 31, 2011, 10:23:36 am ---Can you post a snippet of the content of the "Build log" and the "Build messages" with an error messages that does not work ?
--- End quote ---
Sure:
D\FileProcModular.h|335|error: 'const bool FileProcModular::operator=(long unsigned int)' cannot be overloaded|
Normally if I click on it, it should take me to the file and line, but it doesn't. Some projects do and some don't. So I think there might be a setting issue?
Navigation
[0] Message Index
[#] Next page
Go to full version