Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lisp-kernel/lisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@
#endif
#endif

/* SUPPORT_PRAGMA_UNUSED guards the `#pragma unused(...)' annotations in
{arm,arm64,ppc}-exceptions.c, which record that a parameter forced on a
function by a handler-dispatch signature is deliberately not used. Nothing
in the tree has ever defined it, so those annotations have never reached a
compiler.

#pragma unused is a Metrowerks/MPW-lineage extension: clang implements it,
gcc does not. Measured on the real do_hard_stack_overflow shape, with
-Wall -Wextra, gcc 11.5.0 and clang 15.0.7:

clang both `unused parameter' warnings gone; no diagnostic at all;
-Werror still exits 0.
gcc `ignoring #pragma unused [-Wunknown-pragmas]' AND both `unused
parameter' warnings still present -- one diagnostic added, none
removed; -Werror goes from 2 errors to 3.

Hence clang only. Everywhere else this changes nothing and the annotations
stay dormant; suppressing the warnings there is a build flag's job
(-Wno-unused-parameter). */
#if defined(__clang__)
#define SUPPORT_PRAGMA_UNUSED 1
#endif

#ifndef LOWMEM_BIAS
#define LOWMEM_BIAS (0)
#endif
Expand Down
Loading