https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110003

            Bug ID: 110003
           Summary: Wrong source line listed for unused parameters
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: ad...@tho-otto.de
  Target Milestone: ---

When compiling a module with -Wall and a parameter in the in implementation
module is unused, the error message lists the source line of the definition
module instead:

DEFINITION MODULE foo;

PROCEDURE bla(a: INTEGER);

END foo.


IMPLEMENTATION MODULE foo;

PROCEDURE bla(a: INTEGER);
BEGIN
END bla;

END foo.


$ gm2 -c -Wall foo.mod

./foo.def:3:15: warning: In procedure 'bla': unused parameter 'a' in procedure
'bla'
    3 | PROCEDURE bla(a: INTEGER);
      |               ^

That information is rather useless, because an unused parameter can only be
unused in the implementation.

Reply via email to