Pragma directives specify machine-specific or operating system-specific compiler features. A line that starts with #pragma specifies a pragma directive.
In C, the #pragma directive is a special purpose directive that is used to turn on or off some features. #pragma also allows us to provide some additional...
pragma_statement The pragma that you want to go into the generated .idl file. Remarks. The pragmaC++ attribute has the same functionality as the pragma...
The ‘#pragma’ directive is the method specified by the C standard for providing additional information to the compiler, beyond what is conveyed in the language itself.
See also the _Pragma operator that is defined in newer versions of the C/C++ standards (and serves the same purpose, but with a slightly different syntax).
The method of use is: #Pragma message("Message Text") When the compiler encounters this instruction, it prints the message text in the compile output window.
is a preprocessor directive in its own right; it can't be used within a
#define
directive.So, this is why
__pragma
exists: it provides a way for a pragma to be issued from wherever the macro that uses it is expanded.This is a non-standard compiler extension (MSVC, Intel, and some C compilers support it to varying degrees). See also the
_Pragma
operator that is defined in newer versions of the C/C++ standards (and serves the same purpose, but with a slightly different syntax).
23 Mayıs 2017
15 kişi değerlendirdi
1 yorum
{"2_l3p1":{"state":{"logo":{"href":"//yandex.com.tr","isForeign":true},"form":{"action":"/search/","searchLabel":"Bul","hiddenInputs":[{"name":"lr","value":21206}]},"actions":{"advancedSearch":{"checked":false,"ariaLabel":"Gelişmiş arama"},"moreButtonProps":{"ariaLabel":"Daha fazla"},"cbir":{"name":"cbir","label":"Поиск по картинке","infoUrl":"//yandex.ru/promo/photosearch/index?source=landingdesk","isMacOS":false}},"userSection":{"loggedIn":false,"loginProps":{"loginUrl":"https://passport.yandex.com.tr/auth?retpath=%2F&origin=serp_desktop_auth_new","loginText":"Giriş yap","burgerAriaLabel":"Menü"}},"navigation":{"tabs":[{"id":"www","label":"Arama","url":"//yandex.com.tr","params":{"source":"tabbar"},"target":""},{"id":"images","label":"Görsel","url":"//yandex.com.tr/gorsel/search","params":{"text":"[$query]","noreask":"[$noreask]","nomisspell":"[$nomisspell]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"video","label":"Video","url":"//yandex.com.tr/video/search","params":{"text":"[$query]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"maps","label":"Haritalar","url":"//yandex.com.tr/harita","params":{"text":"[$query]","source":"serp_navig"}},{"id":"translate","label":"Çeviri","url":"//ceviri.yandex.com.tr","params":{"text":"[$query]","from":"tabbar"}}],"selectedTabId":"www","fixedTabsCount":1},"context":{"query":"pragma c","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL","noreask":"1","lr":"21206","counters":{"type":"b","data":{"$header":"0_cr4z000","logo":"0_cr4z001","login":"0_cr4z003","usermenu":"0_cr4z004","market-cart":"0_cr4z006","more-button":"0_cr4z007","cbir":"0_cr4z008","$navigation":"0_cr4z009","item":"0_cr4z00i","tab-www":"0_cr4z00b","tab-images":"0_cr4z00d","tab-video":"0_cr4z00f","tab-maps":"0_cr4z00h","tab-translate":"0_cr4z00j"}}},"loggedIn":false,"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"0_cr4w01-0-1"},"ui":"desktop","service":"web","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL","fast":{"name":"header-desktop"}}}}},"type":"header-desktop"},"2_cr40":{"state":{"answersUrl":"https://stackoverflow.com/questions/23790112/what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma#answers","type":"fact","tabsOptions":[{"id":"question","text":"Soru"},{"id":"bestAnswer","text":"En iyi yanıt"}],"tabContents":{"question":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"The following macros confused me. I wondering what is __pragma and wwhat are the differences between __pragma and #pragma."}]},{"type":"code","content":[{"type":"text","content":[{"type":"text","color":"comment","content":"#define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))"}]},{"type":"text","content":[{"type":"text","color":"comment","content":"#define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))"}]}]}],"footerProps":{"date":1400679264,"numLiked":6,"numCommented":1}},"bestAnswer":{"construct":[{"type":"paragraph","content":[{"type":"code","content":[{"type":"text","content":"#pragma"}],"isInline":true},{"type":"text","content":" is a preprocessor directive in its own right; it can't be used within a "},{"type":"code","content":[{"type":"text","content":"#define"}],"isInline":true},{"type":"text","content":" directive."}]},{"type":"paragraph","content":[{"type":"text","content":"So, this is why "},{"type":"code","content":[{"type":"text","content":"__pragma"}],"isInline":true},{"type":"text","content":" exists: it provides a way for a pragma to be issued from wherever the macro that uses it is expanded."}]},{"type":"paragraph","content":[{"type":"text","content":"This is a non-standard compiler extension (MSVC, Intel, and some C compilers support it to varying degrees). See also the "},{"type":"code","content":[{"type":"text","content":"_Pragma"}],"isInline":true},{"type":"text","content":" operator"},{"type":"text","content":" that is defined in newer versions of the C/C++ standards (and serves the same purpose, but with a slightly different syntax)."}]}],"footerProps":{"date":1495531922,"numLiked":15,"numCommented":1}},"moreAnswers":[]},"organic":{"faviconProps":{"src":"https://favicon.yandex.net/favicon/v2/https://stackoverflow.com","size":"m","pageNumber":0,"index":0},"title":"What is __\u0007[pragma\u0007] and what are the differences between __\u0007[pragma\u0007] and #\u0007[pragma\u0007]","pathProps":{"items":[{"url":"https://stackoverflow.com/questions/23790112/what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma","text":"stackoverflow.com"},{"url":"https://stackoverflow.com/questions/23790112/what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma","text":"what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma"}]},"faviconPosition":0,"subtitlePosition":1,"linkProps":{"url":"https://stackoverflow.com/questions/23790112/what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma"},"hostTitle":"stackoverflow.com","description":""},"extralinksProps":{"hidden":true,"directions":["bottom-end"],"items":[{"variant":"reportFeedback","reportFeedback":{"feature":"Блок ответов для разработчиков","title":"Bu yanıtta yanlış olan nedir?","checkBoxLabels":[{"value":"Yanıt sorguya uygun değil"},{"value":"Yanıt hatalı"},{"value":"Yanıttaki bilgiler eksik"},{"value":"Diğer"}]}}]},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_cr4w0c-0-1"},"ui":"desktop","service":"web","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL","fast":{"name":"article"}}}}},"type":"article"},"2_cr41":{"state":{"linksGroups":[{"type":"geo","links":[{"label":"Columbus","title":"Columbus","url":"//yandex.com.tr/tune/geo","logNode":{"name":"region"},"target":"_self","a11yLabel":"Bölgeniz Columbus","needRetpath":true}]},{"type":"feedback","links":[{"label":"Hata bildir","logNode":{"name":"feedback","attrs":{"behaviour":{"type":"dynamic"}}}}]},{"type":"settings","links":[{"label":"Ayarlar","url":"//yandex.com.tr/tune/search","logNode":{"name":"settings"},"target":"_self","needRetpath":true}]},{"type":"company","links":[{"label":"Hakkımızda","url":"https://company.yandex.com.tr","logNode":{"name":"about"},"target":"_blank"},{"label":"Ticari teklifler","url":"/search/direct?text=pragma%20c&filters_docs=direct_cm","logNode":{"name":"commercial"},"target":"_blank"},{"label":"Kariyer","url":"//yandex.com.tr/jobs/?utm_source=serp_turkie&utm_medium=footerlink&utm_content=career","logNode":{"name":"vacancy"},"target":"_blank"},{"label":"Kullanım lisansı","url":"//yandex.com.tr/legal/termsofuse/","logNode":{"name":"license"},"target":"_blank"},{"label":"Gizlilik Politikası","url":"//yandex.com.tr/legal/confidential/","logNode":{"name":"confidential"},"target":"_blank"}],"a11yHidden":true}],"reportFeedbackProps":{"feature":"Подвал","title":"Hata bildir","checkBoxLabels":[]},"isSearchApp":false,"hasExtralinks":true,"limitingSelector":".AliceFabButton","baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_cr4w0d-0-1"},"ui":"desktop","service":"web","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL"}}}},"type":"serp-footer"},"2_cr42":{"state":{"conditionLoadList":{"marketCart":false,"highchartsHighstock":false,"advProductGallery":false,"musicPlayer":false,"ecomRates":false,"photoViewer":false,"darkmodeChangeDrawer":true},"reportFeedbackBaseProps":{"initEmail":"","metaFields":{"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","userTestids":"186144,1028332,1052826,1050491,1046807,1042349,1038759,1048792,1053350,1054631,1056268,1052649,1039135,1031689,614106,1007884,1058434,1055127,260554,1053954,123850,1045386,1056568,1046931,1045125,1036351,1056512,1038163,1055970,658770,364898,1052192,891392,1054081,1056359,1047659,1051713,1053973,1045505,1051607,1054781,1056091,961010,912217,1011548,1051549,1045239,1056241,90498,1044599,151171,1056946,1058163,13962,287509,1048567,338390,1006026,1058519,1036087,1017496,1036347,1048635,1058336,1047580,1051464,912286","yandexuid":"9626065631720256566","uid":"0","queryText":"pragma c","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL","searchSlices":["drawer_search_slice_cs"],"userRegionName":"Columbus","userRegionId":"20815"}},"extralinksPopupProps":{"abuseLink":"https://twitter.yandex.com.tr/search/abuse?sign=38b006726ed909f7b56ad49545e0fcc7&keyno=0"},"isLoggedIn":false,"userMenuDialogProps":{"flag":"skin,feedback","host":"yandex.com.tr","lang":"tr","project":"serp","queryParams":{"utm_source":"search"},"retpath":"https%3A%2F%2Ftwitter.yandex.com.tr%2Fsearch%2F%3Fes_context%3D0oYmAQ____________ARpMMTcxOTQyNzk3NTAzNTkyNC0xMjIxNjMxNDkxMDE5NzYwMDE1OS1iYWxhbmNlci1sN2xldmVsZXIta3Vici15cC1rbGctMjYyLUJBTDIFYXNzb2OScDtP%26lr%3D21206%26noreask%3D1%26rq%3D1%26serp-reload-from%3Drec_bottom%26text%3Dpragma%2Bc%26ncrnd%3D29147","tld":"com.tr"},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_cr4w0e-0-1"},"ui":"desktop","service":"web","reqid":"1720256588937105-15240242522913039176-balancer-l7leveler-kubr-yp-klg-77-BAL","fast":{"name":"lazy-load"}}}}},"type":"lazy-load"}}