Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Miguel Gimenez on November 04, 2019, 12:27:35 pm

Title: Commit 11895 fails detecting Clang
Post by: Miguel Gimenez on November 04, 2019, 12:27:35 pm
Commit 11895 applied the changes proposed in ticket 870, but inverted the test order making Clang undetectable. Clang also defines __GNUC__, so the code in the commit:

Code
#if defined (__GNUC__)
                                            + _T(" - gcc ") + (wxString() << __GNUC__)
                                            + _T(".")       + (wxString() << __GNUC_MINOR__)
                                            + _T(".")       + (wxString() << __GNUC_PATCHLEVEL__)
#elif defined (__clang__)
                                            + _T(" - clang ")  + (wxString() << __clang_major__)
                                            + _T(".")          + (wxString() << __clang_minor__)
                                            + _T(".")          + (wxString() << __clang_patchlevel__)
#endif

will never detect it. The code should be

Code
#if defined (__clang__)
                                            + _T(" - clang ")  + (wxString() << __clang_major__)
                                            + _T(".")          + (wxString() << __clang_minor__)
                                            + _T(".")          + (wxString() << __clang_patchlevel__)
#elif defined (__GNUC__)
                                            + _T(" - gcc ") + (wxString() << __GNUC__)
                                            + _T(".")       + (wxString() << __GNUC_MINOR__)
                                            + _T(".")       + (wxString() << __GNUC_PATCHLEVEL__)
#endif

See https://sourceforge.net/p/codeblocks/tickets/870/#5424 onwards for more information
Title: Re: Commit 11895 fails detecting Clang
Post by: oBFusCATed on November 04, 2019, 07:37:34 pm
I have a fix for this... and all the other places which had to be modified...