Fix -Wdeprecated-non-prototype warnings

Bug #1996921 reported by Matthew Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Undecided
Unassigned

Bug Description

Two K&R function definitions in vars.c and a function pointer with an empty argument list in traceroot.c cause warnings in clang 15, which may become errors by default in clang 16.

vars.c:94:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
struct var *lookup_by_name(name)
            ^
vars.c:105:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
struct var *lookup_by_obj(obj)
            ^
traceroot.c:257:36: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
                    context_scanner(compare_pointer, c);
                                    ^

Tags: review
Revision history for this message
Matthew Smith (matthew-sm) wrote :
Douglas Katzman (dougk)
Changed in sbcl:
status: New → Fix Committed
Revision history for this message
Douglas Katzman (dougk) wrote :

TBH we got 1 warning less without this patch. Now we get:

traceroot.c: In function 'deduce_thread':
traceroot.c:258:37: warning: passing argument 1 of 'context_scanner' from incompatible pointer type [-Wincompatible-pointer-types]
  258 | context_scanner(compare_pointer, c);
      | ^~~~~~~~~~~~~~~
      | |
      | void (*)(void *)
traceroot.c:258:37: note: expected 'void (*)(void)' but argument is of type 'void (*)(void *)'

Can you provide a better fix please?

Changed in sbcl:
status: Fix Committed → Fix Released
Revision history for this message
Douglas Katzman (dougk) wrote :

was not released in full. It caused other warnings, so I backed out part of it

Changed in sbcl:
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.