https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121289
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>: https://gcc.gnu.org/g:e79e0fe2b1f101485e5e63e674e133692a3a0cb4 commit r16-2599-ge79e0fe2b1f101485e5e63e674e133692a3a0cb4 Author: Gaius Mulley <gaiusm...@gmail.com> Date: Tue Jul 29 09:09:58 2025 +0100 PR modula2/121289 Poor warning location when using Wstyle option This patch adds a token location parameter to CheckVariableAgainstKeyword and dependants ensuring that the warning is generated from the token associated with the variable rather than the end of the statement. gcc/m2/ChangeLog: PR modula2/121289 * gm2-compiler/M2Students.def (CheckVariableAgainstKeyword): New parameter tok. * gm2-compiler/M2Students.mod (CheckVariableAgainstKeyword): New parameter tok. Pass tok to PerformVariableKeywordCheck. (PerformVariableKeywordCheck): New parameter tok. Pass tok to MetaErrorStringT0. * gm2-compiler/P2SymBuild.mod (BuildVariable): Pass tok to CheckVariableAgainstKeyword. * gm2-libs-iso/LowLong.mod (except): Replace with ... (exceptSrc): ... this. * gm2-libs-iso/LowReal.mod (except): Replace with ... (exceptSrc): ... this. * gm2-libs-iso/LowShort.mod (except): Replace with ... (exceptSrc): ... this. * gm2-libs-iso/Processes.mod (Wait): Replace from with fromCor. * gm2-libs-iso/RndFile.mod (EndPos): Replace end with endP. * gm2-libs/SCmdArgs.mod (GetArg): Replace start with startPos. Replace end with endPos. (NArg): Replace start with startPos. Replace end with endPos. gcc/testsuite/ChangeLog: PR modula2/121289 * gm2/warnings/style/fail/badvarname.mod: New test. * gm2/warnings/style/fail/warnings-style-fail.exp: New test. Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>