compiler warning
A message from the compiler or an analyzer about code that builds but is probably wrong, identified by a code such as CS8602.
In more detail
Warnings do not stop the build unless warnings are treated as errors. Read the identifier first; it leads to documentation explaining the risk.
Related terms
- diagnostic — A message the compiler or an analyzer reports about code, carrying a rule identifier such as CA2000, a severity and an explanation.
- TreatWarningsAsErrors — The build property that turns every compiler and analyzer warning into an error, so code with warnings fails to build.
- CS8602 — The C# compiler warning 'dereference of a possibly null reference', raised when code uses a value that might be null without checking it.
- CS8509 — The C# compiler warning that a switch expression does not handle all possible input values, naming one that no arm matches.
Taught in
- The C# Language: Types, Variables, and Flow Control — Modern .NET Core, C# & Enterprise Microservices
- Records, Pattern Matching, and Modern C# — Modern .NET Core, C# & Enterprise Microservices
- Directory.Build.props, global.json and Central Packages — Modern .NET Core, C# & Enterprise Microservices
- Code Quality: .editorconfig and Roslyn Analyzers — Modern .NET Core, C# & Enterprise Microservices