{"id":8563,"date":"2012-01-13T07:00:00","date_gmt":"2012-01-13T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2012\/01\/13\/how-do-i-print-non-error-messages-during-compilation\/"},"modified":"2012-01-13T07:00:00","modified_gmt":"2012-01-13T07:00:00","slug":"how-do-i-print-non-error-messages-during-compilation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20120113-00\/?p=8563","title":{"rendered":"How do I print non-error messages during compilation?"},"content":{"rendered":"<p>Commenter Worf remarked,  &#8220;<a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2008\/04\/09\/8370479.aspx#8374137\">My one wish is that <code>#warning<\/code> would be supported<\/a>.&#8221;\n  I always find it interesting when people say  &#8220;I wish that Microsoft  would stop following standards,&#8221;  since the <code>#warning<\/code> directive is nonstandard.\n  The Microsoft C\/C++ compiler implements the feature in  a method compatible with the standard,  namely via a <code>#pragma<\/code> directive.\n<code>  #pragma message(\"You really shouldn't be doing that.\")  <\/code>\n  If you want to warn people away from deprecated functionality,  you can use  <a href=\"http:\/\/msdn.microsoft.com\/library\/c8xdzzhh.aspx\">  the <code>#pragma deprecated()<\/code> directive<\/a>  or the even more convenient (but more standards-troublesome)  <a href=\"http:\/\/msdn.microsoft.com\/library\/044swk7y.aspx\">  <code>__declspec(deprecated)<\/code> declaration specifier<\/a>.  The declaration specifier is much more convenient than the preprocessor  directive because you can use it in a macro,  and you can attach it to specific overloads of a function.  (It&#8217;s also more standards-troublesome because, while it is still  permitted by the standard because it begins with a double-underscore,  it is also not required to be ignored by compilers which do not  understand it.)<\/p>\n<p>  In my experience, however, printing messages during compilation is  of little consequence.  Print all the messages during compilation as you want;  <a href=\"http:\/\/blogs.msdn.com\/b\/larryosterman\/archive\/2011\/05\/03\/nobody-ever-reads-the-event-logs.aspx\">  nobody will read them<\/a>.  The only thing that gets attention is an actual warning or error.  (And in many cases, only the error will get any attention at all.)  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commenter Worf remarked, &#8220;My one wish is that #warning would be supported.&#8221; I always find it interesting when people say &#8220;I wish that Microsoft would stop following standards,&#8221; since the #warning directive is nonstandard. The Microsoft C\/C++ compiler implements the feature in a method compatible with the standard, namely via a #pragma directive. #pragma message(&#8220;You [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-8563","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Commenter Worf remarked, &#8220;My one wish is that #warning would be supported.&#8221; I always find it interesting when people say &#8220;I wish that Microsoft would stop following standards,&#8221; since the #warning directive is nonstandard. The Microsoft C\/C++ compiler implements the feature in a method compatible with the standard, namely via a #pragma directive. #pragma message(&#8220;You [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=8563"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8563\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=8563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=8563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=8563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}