Sorry for the delay in reply.
Not to do with your two main questions, but just to note that returning const values of any sort is kind of a waste of time in C++.
Const means read-only. Returning a bool (it was written on stack overflow {the website}), a user might attempt to over-write it (ReturnBool() = true), which would cause a crash (temporary variable?). It's extremely useful when passing by reference (so you know the variable being referred can't be altered). Generally good practice to make sure returning variables are read-only unless otherwise explicitly stated.
Yes, but this depends on the compiler, for gcc check the various -W options.
Then you set the options in Project->build options -> target -> compiler -> other (if there is no such option in the main options)
I think it's GCC. Is a pragma command possible?
Just copy and paste, please do not post a screenshot, if it is not absolutely necessary.
D\FileProcModular.h|21|warning: multi-character character constant|
D\FileProcModular.h|22|warning: multi-character character constant|
D\FileProcModular.h|23|warning: multi-character character constant|
D\FileProcModular.h|25|warning: multi-character character constant|
D\FileProcModular.h|26|warning: multi-character character constant|
D\FileProcModular.h|27|warning: multi-character character constant|
D\FileProcModular.h|29|warning: multi-character character constant|
D\FileProcModular.h|30|warning: multi-character character constant|
D\FileProcModular.h|31|warning: multi-character character constant|
D\FileProcModular.h|33|warning: multi-character character constant|
D\FileProcModular.h|34|warning: multi-character character constant|
D\FileProcModular.h|35|warning: multi-character character constant|
D\CharList.h||In member function 'const bool CharList::CopyBetweenStrings(const char*, const char*, const char*, bool)':|
D\CharList.h|504|warning: declaration of 'End' shadows a member of 'this'|
D\CharList.h|504|warning: declaration of 'Start' shadows a member of 'this'|
D\CharList.h|512|warning: unused variable 'C_Ptr_End'|
||=== Build finished: 0 errors, 15 warnings ===|
There is a plugin in C::B to test your regex, too. (regular expressions testbed or something like that).
But I don't know exactly if C::B only use POSIX, or support PERL, or a mix between them, or a "POSIX-LITE".
Can you tell me valid regular expressions?
bool myFunc() { return true; }
if (myFunc()=true) <-- this cannot crash, because the temporary is valid/alive until the closing brace!
const bool myFunc() is total waste of typing and then reading, keep in mind that reading code takes 90% of the time!
Some info const by a real guru: http://www.gotw.ca/gotw/081.htm
Consider:
class Test
{
public:
int A;
Test(){A = 0;}
};
const Test &ReturnTest1(){Test N; return N;}
const Test ReturnTest2(){Test N; return N;}
Test &ReturnTest3(){Test N; return N;}
Test ReturnTest4(){Test N; return N;}
int main(int ArgC, char *ArgV[])
{
ReturnTest1().A = 1; //Produces an access violation as it's const
ReturnTest2().A = 1; //Produces an access violation as it's const
ReturnTest3().A = 1; //No violation (as a reference this could be bad)
ReturnTest4().A = 1; //No violation (as a copy this would be pointless)
return 0;
}
Even though C++ doesn't enforce const bools/ints/floats/chars, it does with classes, and it is a good habit to code consistently across the board, given that is the intention. Const at the start right away tells it's returning read-only (and thus shouldn't be modified anyway), and by making it the default (even if seemingly redundant), it becomes a habit that is applied to other classes.
It's a matter of indicating intentions. If I put const float (instead of const float&) by accident, anyone correcting that, knows the reference need to be read-only. If I put just float, a person could correct to float&, and thus it would be valid for the user to internally modify it. Not good.
Please try the regular expression testbed plugin (it is in the plugins menu and you need the contrib plugins installed).
Keep in mind that using regular expressions require thinking and creativity, they are no silver bullet!
Is there a manual I could read on the topic? I don't think I have that plugin installed.
Last try, after that I give up:
Please read carefully:
Can you post a snippet of the content of the "Build log" and the "Build messages" with an error messages that does not work ?
Just copy and paste, please do not post a screenshot, if it is not absolutely necessary.
Build log:
-------------- Build: Release in SelfBuilding ---------------
Compiling: main.cpp
In file included from C:\Users\user\Desktop\Projects\R&D\main.cpp:6:
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:21:25: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:22:24: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:23:26: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:25:23: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:26:22: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:27:24: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:29:30: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:30:29: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:31:31: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:33:30: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:34:29: warning: multi-character character constant
C:\Users\user\Desktop\Projects\R&D\FileProcModular.h:35:31: warning: multi-character character constant
In file included from C:\Users\user\Desktop\Projects\R&D\StrToken.h:9,
from C:\Users\user\Desktop\Projects\R&D\HTMLFileProc.h:9,
from C:\Users\user\Desktop\Projects\R&D\main.cpp:5:
C:\Users\user\Desktop\Projects\R&D\DataArray.h: In member function 'const bool DataArray::CopyBetweenStrings(const char*, const char*, const char*, bool)':
C:\Users\user\Desktop\Projects\R&D\DataArray.h:190: error: 'StringString' was not declared in this scope
C:\Users\user\Desktop\Projects\R&D\DataArray.h:207: warning: suggest parentheses around assignment used as truth value
C:\Users\user\Desktop\Projects\R&D\DataArray.h:207: error: expected primary-expression before ')' token
C:\Users\user\Desktop\Projects\R&D\DataArray.h:207: error: expected ';' before ')' token
Process terminated with status 1 (0 minutes, 1 seconds)
3 errors, 13 warnings
Build messages:
D\FileProcModular.h|21|warning: multi-character character constant|
D\FileProcModular.h|22|warning: multi-character character constant|
D\FileProcModular.h|23|warning: multi-character character constant|
D\FileProcModular.h|25|warning: multi-character character constant|
D\FileProcModular.h|26|warning: multi-character character constant|
D\FileProcModular.h|27|warning: multi-character character constant|
D\FileProcModular.h|29|warning: multi-character character constant|
D\FileProcModular.h|30|warning: multi-character character constant|
D\FileProcModular.h|31|warning: multi-character character constant|
D\FileProcModular.h|33|warning: multi-character character constant|
D\FileProcModular.h|34|warning: multi-character character constant|
D\FileProcModular.h|35|warning: multi-character character constant|
D\DataArray.h||In member function 'const bool DataArray::CopyBetweenStrings(const char*, const char*, const char*, bool)':|
D\DataArray.h|190|error: 'StringString' was not declared in this scope|
D\DataArray.h|207|warning: suggest parentheses around assignment used as truth value|
D\DataArray.h|207|error: expected primary-expression before ')' token|
D\DataArray.h|207|error: expected ';' before ')' token|
||=== Build finished: 3 errors, 13 warnings ===|
The error messages will vary as I am working on the project. Just that being unable to jump to the specific error lines is time-consuming.
The problem applies to any warnings/errors (if this wasn't clear in the original post).