Author Topic: Commit 11895 fails detecting Clang  (Read 4348 times)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Commit 11895 fails detecting Clang
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Commit 11895 fails detecting Clang
« Reply #1 on: November 04, 2019, 07:37:34 pm »
I have a fix for this... and all the other places which had to be modified...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]