Xcode 9: How to hide these warning messages?

Viewed 1078

Since the update for the Xcode 9 the warning and error messages are disturbing me...

How to minimize or hide these messages?

enter image description here

1 Answers

Clearly, in this case, you'd probably want to heed the warning and change start and end to unsigned long. The warning will go away.

The feature to show/hide issues (in Xcode "Editor" menu, "Issues" » "Show/Hide All Issues") feature appears to be broken in Xcode 9 (as well as Xcode 9.1 Beta 1). It works in Xcode 8, but not Xcode 9 as of this date.


If you want to completely silence the warning, you can use #pragma clang diagnostic:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32"

void benchmarkSort() {
    for (int i = 0; i < numMax; i++)
        vetAux[i] = vet[i];

    start = clock();
    BubbleSort(numMax, vetAux);
    end = clock();
}

#pragma clang diagnostic pop

Or you can obviously supply the -Wno-shorten-64-to-32 compiler option to silence it for a particular "Compile Source" in the "Build Phases" tab of the target settings. Or you can supply this compile flag in your "Build Settings" to silence this for the whole project.

And if you're wondering what the -W code is for a particular error (-Wshorten-64-to-32 in this case), go to the "Issue Navigator" in the left panel, control-click on the the warning and choose the "Reveal in Log" option, and it will take you right to the log, and you'll see what the warning code was:

enter image description here

Related