In the context of software development, what is the primary purpose of a "warning" message generated by a compiler?
A. To indicate a critical error that prevents the program from running.
B. To notify the developer of a potential issue or bad practice in the code that may not stop compilation but could lead to runtime errors.
C. To display information about the successful execution of the code.
D. To automatically correct errors in the code and optimize performance.