Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use #pragma clang diagnostics

I know that #pragma clang diagnostics can be used for ignoring some warnings generated by clang. But I don't know how to use this correctly.

For example, for an unused variable warning we can avoid warning by

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"

int number;

#pragma clang diagnostic pop

But I don't know how to get correct parameter for #pragma clang diagnostic ignored ("-Wunused-variable" here)

Is there any way to fing this kind of warning name for specific warnings with xcode?

like image 428
Johnykutty Avatar asked Nov 19 '13 18:11

Johnykutty


People also ask

How do we use a semicolon?

Use a semicolon to join two related independent clauses in place of a comma and a coordinating conjunction (and, but, or, nor, for, so, yet). Make sure when you use the semicolon that the connection between the two independent clauses is clear without the coordinating conjunction.

When should a semicolon be used examples?

A semicolon may be used between independent clauses joined by a connector, such as and, but, or, nor, etc., when one or more commas appear in the first clause. Example: When I finish here, and I will soon, I'll be glad to help you; and that is a promise I will keep.

How do you use commas and semicolons?

When a comma separates two complete sentences joined by a conjunction (and, but, or, nor, for, so, or yet) the comma and the conjunction can be replaced with a semicolon. I ate dinner, and I went to the movies. = I ate dinner; I went to the movies.

How do you use dashes correctly?

Use dashes to mark the beginning and end of a series, which might otherwise get confused, with the rest of the sentence: Example: The three female characters—the wife, the nun, and the jockey—are the incarnation of excellence. Dashes are also used to mark the interruption of a sentence in dialogue: Example: “Help!


2 Answers

Right click on the issue in the issue navigator and select "Reveal in Log". The error message will specify the warning.

like image 66
iOS Gamer Avatar answered Oct 19 '22 21:10

iOS Gamer


You can look up the warning command line parameter if you know the message: Diagnostic flags in Clang

like image 20
AndiDog Avatar answered Oct 19 '22 19:10

AndiDog