This happens due to display-warning
delaying warnings until after init time. By then, the file name and location are no longer known.
(defun display-warning (type message &optional level buffer-name)
[...]
(if (not (or after-init-time noninteractive (daemonp)))
;; Ensure warnings that happen early in the startup sequence
;; are visible when startup completes (bug#20792).
(delay-warning type message level buffer-name)
(unless level
[... ]
You should be able to disable this with some advice:
(defun dont-delay-compile-warnings (fun type &rest args)
(if (eq type 'bytecomp)
(let ((after-init-time t))
(apply fun type args))
(apply fun type args)))
(advice-add 'display-warning :around #'dont-delay-compile-warnings)
Although this might prevent the *Warnings*
buffer from popping up (as described in Bug#20792), so you'll have to check it manually in the *Compile-Log*
buffer.
Previous case of this, reported on emacs-devel here (continues here).