Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use "#pragma GCC ..." or "#pragma clang ..." in Xcode

Which of these should I use to ignore a warning?

#pragma clang diagnostic ignored "-W<warning>"
#pragma GCC diagnostic ignored "-W<warning>"

Both seems to work for me, however which one is the correct to use?

Should I always use the one matching the compiler I'm using?

like image 236
Tyilo Avatar asked Aug 07 '12 02:08

Tyilo


People also ask

Should I use in a sentence?

“You should stop eating fast food.” “You should go for walks more often.” “We should go to the park tomorrow.” “He should go to the pharmacy first thing in the morning.”

Should I use used or use?

Used to refers to something familiar or routine, as in "I'm used to getting up early for work," or to say that something repeatedly happened in the past like "we used to go out more." Use to typically occurs with did; "did you use to work there?" or "it didn't use to be like that," describing something in the past that ...

Where to use should I?

Should is used to say that something is the proper or best thing to do, or to say that someone ought to do something or must do something. Adam could visit us on Monday. This tells us that it is possible Adam will visit on Monday, maybe he can visit us, but maybe he has other options, too.

Is I should of grammatically correct?

Should have is often expressed as the contraction should've, especially in speech. Should've sounds perilously like should of, however should of is not correct and should never be used. Contractions have been around as long as the English language, many examples exist in Old English.


1 Answers

Generally, you should prefer #pragma GCC in cases where the pragma is GCC-specific, or is equally applicable to GCC, Clang, and other compilers which try to be GCC-compatible (such as ICC). Use #pragma clang in cases where the pragma is in some way Clang-specific (such as a diagnostic option which doesn't exist in GCC).

like image 171
Richard Smith Avatar answered Sep 18 '22 20:09

Richard Smith