emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improved warning about called to undefined functions


From: Richard Stallman
Subject: Improved warning about called to undefined functions
Date: Mon, 29 Jan 2024 22:56:22 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

The byte compiler makes a list of unknown functins referenced.
At the end of the file, it outputs a warning listing the names
of those that were not defined in the file.

That is usually enough, because most of the time there will be few
spurious matches for the function name.  The extreme exceptional case
is the , function, and that is now handled optimally.

But it might nonetheless be useful to get a warning for each call to
an undefined function.  I have a suggestion for how to do that.

On finding a call to an undefined function, push a warning item
including the call's source location data onto a list of tentative
warnings.  At the end of the file, instead of just listing the names
of the functions that remain undefined, for each such function output
warnings using that warning data, a warning for each of the calls seen
to that function.

A more radical idea to make snazzier output:
warn immediately about each call to an undefined function.
Also make a list of those functions, as now, and data about the
warnings shown about them.

On seeing a definition for any of those functions,
delete in the *Compile-Log* buffer all warnings about
calling that undefined function.  This way, each warning will
appear in the proper place, those that have not been deleted.

Or, save with each tentaive warning's data a marker to the place
that warning should go.  At end of file, insert each of those warnings
where it ought to go.

Those are three methods of inserting the same warnings into *Compile-Log*.
I don't know which one users would like better.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]