This warning is built into
save-buffers-kill-emacs. You can't disable it easily.
A simple way to get rid of it is to tell Emacs to save all buffers, by passing a prefix argument to the
save-buffers-kill-emacs command (or
save-buffers-kill-terminal which calls it): type
C-u C-x C-c instead of
C-x C-c. However you may not want to do that.
You can use the advice facility to modify the behavior of functions. Here, it's cumbersome because the code calls a generic function (
yes-or-no-p) right in the middle of some logic that's hard to hack.
(around save-buffers-kill-emacs-no-modified-yes-no activate compile))
(let ((real-yes-or-no-p (symbol-function 'yes-or-no-p)))
(flet ((yes-or-no-p (msg)
(or (equal msg "Modified buffers exist; exit anyway? ")
(funcall real-yes-or-no-p msg)))))
You may prefer to copy the definition and remove the offending call, however this is likely to require more maintenance as Emacs evolves.
Do you really need this? First, warning of unsaved changes is usually a good idea, which is why Emacs does it. Second, it's typical to start Emacs with your session and exit it when you log out, so exiting Emacs is something that happens rarely.