Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: BlueHazzard on February 08, 2018, 10:51:24 pm

Title: Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] path
Post by: BlueHazzard on February 08, 2018, 10:51:24 pm
I have a invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] setting in my config. To reproduce:
1) Create a new compiler in the compiler options
2) Leave the path empty and save the settings.

Now if you open codeblocks you get the AutoDetectCompilers dialog. Now if you scroll trough the entries all are valid, but the invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] is "Not-Found" as all other default compilers that have no path set. This should not be the case. If the compiler is user added there should be a big red warning that this compiler has no path, or is invalid....

Now i looked into the code and found this:
sdk\autodetectcompilers.cpp:59
Code
            wxString path = compiler->GetMasterPath();
            wxString path_no_macros = compiler->GetMasterPath();
            Manager::Get()->GetMacrosManager()->ReplaceMacros(path_no_macros);

            int idx = list->GetItemCount() - 1;
            int highlight = 0;
            if (path.IsEmpty() && Manager::Get()->GetConfigManager(wxT("compiler"))->Exists(wxT("/sets/") + compiler->GetID() + wxT("/name")))
            {
                // Here, some user-interaction is required not to show this
                // dialog again on each new start-up of C::B.
                list->SetItem(idx, 1, _("Invalid"));
                // So we better clearly HIGHLIGHT this entry:
                highlight = 1;
            }
            else // The compiler is *probably* invalid, but at least a master-path is set
            {
                list->SetItem(idx, 1, _("Not found"));
                highlight = -1;
            }

what is
Code
Manager::Get()->GetConfigManager(wxT("compiler"))->Exists(wxT("/sets/") + compiler->GetID() + wxT("/name"))
. Why is there a differentiation? If the master path is empty this should be "invalid" or not?

can someone bring light to this?
thank you!
Title: Re: Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] [YOUR ANSWER IS
Post by: BlueHazzard on February 08, 2018, 10:53:09 pm
WTF? Is there a auto insert thing for forum posts with "Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]" keyword? I did not added this
Quote
[YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]
thing xD
Title: Re: Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] [YOUR ANSWER IS
Post by: BlueHazzard on February 08, 2018, 10:55:51 pm
Ok, this is going out of hand now with the title
Title: Re: Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] path
Post by: oBFusCATed on February 09, 2018, 01:40:28 am
Yes, there is detection of the words i n v a l i d c o m p i l e r. And they are replaced with this message. There are too many people posting about it, so we had to take this measure.