#1,128 – Disable a Compile-Time Warning for Entire Project

You can use #pragma warning to selectively disable certain warnings that occur when compiling your code.  When #pragma warning disable is encountered, the specified warning will be disabled for the current file, from the point where the pragma appears until the end of the file, or until a #pragma warning restore is encountered for the same warning.

If you want to disable a particular warning for all files compiled in a project, rather than just within a single file, you can add the warning number to the Suppress warnings field on the Build tab in the project properties window.  This will suppress the specified warning for the entire project.




About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,128 – Disable a Compile-Time Warning for Entire Project

  1. Pingback: Dew Drop – July 2, 2014 (#1806) | Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: