Subject: bug#24592: 25.1; byte-compile warning indicates wrong line

From: Eli Zaretskii <[email-masked]>
Date: Mon, 03 Oct 2016 09:50:42 +0300

severity 24592 minor
merge 24592 24449
merge 24449 24128
thanks

> From: [email-masked]
> Date: Mon, 03 Oct 2016 10:18:25 +0900
> 
> 
> Let the contents of the file "tmp.el" be:
> (defun test (files)
>   (and t (string-match 1))
>   (and t (string-match 1 2)))
> 
> Then input M-x byte-compile-file RET tmp.el RET
> 
> *Compile-Log* buffer shows:
> In test:
> tmp.el:3:11:Warning: string-match called with 1 argument, but requires 2-3
> 
> The warning must indicate the line 2.

It's a known issue that the byte compiler cannot report the lines for
warnings and errors accurately.  See, for example, bug#24449,
bug#24128, etc.