[Bug 275305] warning "-Wdeprecated-non-prototype" breaks build a system with "WITH_OFED_EXTRA" option

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 24 Nov 2023 13:11:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275305

            Bug ID: 275305
           Summary: warning "-Wdeprecated-non-prototype" breaks build a
                    system with "WITH_OFED_EXTRA" option
           Product: Base System
           Version: 14.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: yyv83@mail.ru

It looks like the default flags have changed in glang 15.
buildworld ends with the following errors:

---
/usr/src/contrib/ofed/opensm/opensm/st.c:185:11: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
st_table *st_init_table_with_size(type, size)
          ^
/usr/src/contrib/ofed/opensm/opensm/st.c:211:11: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
st_table *st_init_table(type)
          ^
/usr/src/contrib/ofed/opensm/opensm/st.c:222:11: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
st_table *st_init_numtable_with_size(size)
          ^
/usr/src/contrib/ofed/opensm/opensm/st.c:233:11: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
st_table *st_init_strtable_with_size(size)
          ^
/usr/src/contrib/ofed/opensm/opensm/st.c:239:6: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
void st_free_table(table)
     ^
/usr/src/contrib/ofed/opensm/opensm/st.c:279:5: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
int st_lookup(table, key, value)
    ^
/usr/src/contrib/ofed/opensm/opensm/st.c:318:5: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
int st_insert(table, key, value)
    ^
/usr/src/contrib/ofed/opensm/opensm/st.c:338:6: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
void st_add_direct(table, key, value)
     ^
/usr/src/contrib/ofed/opensm/opensm/st.c:350: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]
static void rehash(table)
            ^
/usr/src/contrib/ofed/opensm/opensm/st.c:379:11: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
st_table *st_copy(old_table)
          ^
/usr/src/contrib/ofed/opensm/opensm/st.c:419:5: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
int st_delete(table, key, value)
    ^
/usr/src/contrib/ofed/opensm/opensm/st.c:463:5: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
int st_delete_safe(table, key, value, never)
    ^
/usr/src/contrib/ofed/opensm/opensm/st.c:502:6: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
void st_cleanup_safe(table, never)
     ^
/usr/src/contrib/ofed/opensm/opensm/st.c:512:6: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
void st_foreach(table, func, arg)
     ^
/usr/src/contrib/ofed/opensm/opensm/st.c:547:12: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
static int strhash(string)
           ^
/usr/src/contrib/ofed/opensm/opensm/st.c:581:12: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
static int numcmp(x, y)
           ^
/usr/src/contrib/ofed/opensm/opensm/st.c:587:17: error: a function definition
without a prototype is deprecated in all versions of C and is not supported in
C2x [-Werror,-Wdeprecated-non-prototype]
static st_ptr_t numhash(n)
                ^
17 errors generated.
*** [st.o] Error code 1

make[5]: stopped in /usr/src/usr.bin/ofed/opensm
--- all_subdir_usr.sbin ---

make[4]: stopped in /usr/src/usr.sbin/acpi
--- all_subdir_usr.bin ---
--- all_subdir_usr.bin/clang ---

make[4]: stopped in /usr/src/usr.bin/clang
--- all_subdir_usr.sbin ---

make[3]: stopped in /usr/src/usr.sbin

make[2]: stopped in /usr/src
--- all_subdir_usr.bin ---
--- all_subdir_usr.bin/ofed ---
1 error

make[5]: stopped in /usr/src/usr.bin/ofed/opensm

make[4]: stopped in /usr/src/usr.bin/ofed

make[3]: stopped in /usr/src/usr.bin
--- all_subdir_usr.bin/clang ---
--- all_subdir_usr.bin/clang/llvm-objdump ---

make[4]: stopped in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang/llvm-profdata ---

make[4]: stopped in /usr/src/usr.bin/clang
--- all_subdir_usr.bin/clang/llvm-readobj ---

make[4]: stopped in /usr/src/usr.bin/clang

make[3]: stopped in /usr/src/usr.bin

make[2]: stopped in /usr/src
      114.97 real      2456.39 user       196.50 sys

make[1]: stopped in /usr/src

make: stopped in /usr/src
---


If you add "-Wno-error=deprecated-non-prototype" flag, then buildworld
completed successfully, but I'm not sure that this is the optimal solution.

-- 
You are receiving this mail because:
You are the assignee for the bug.