Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with gcc15 #169

Open
mikelolasagasti opened this issue Feb 7, 2025 · 1 comment
Open

Fails to build with gcc15 #169

mikelolasagasti opened this issue Feb 7, 2025 · 1 comment

Comments

@mikelolasagasti
Copy link

Output form a fresh Fedora 42 container:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I/usr/local/include -I./enc/unicode -Wall -Wno-incompatible-pointer-types -MT st.lo -MD -MP -MF .deps/st.Tpo -c st.c  -fPIC -DPIC -o .libs/st.o
st.c: In function 'do_hash':
st.c:327:43: error: too many arguments to function 'tab->type->hash'; expected 0, have 1
  327 |     st_hash_t hash = (st_hash_t)(tab->type->hash)(key);
      |                                 ~~~~~~~~~~^~~~~~~ ~~~
In file included from regint.h:930,
                 from st.c:106:
st.h:70:18: note: declared here
   70 |     st_index_t (*hash)(ANYARGS /*st_data_t*/);        /* st_hash_func* */
      |                  ^~~~
st.c: In function 'find_entry':
st.c:180:40: error: too many arguments to function '(int (*)(void))tab->type->compare'; expected 0, have 2
  180 | #define EQUAL(tab,x,y) ((x) == (y) || (*(tab)->type->compare)((x),(y)) == 0)
      |                                       ~^~~~~~~~~~~~~~~~~~~~~~ ~~~
st.c:182:35: note: in expansion of macro 'EQUAL'
  182 |     ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key))
      |                                   ^~~~~
st.c:189:15: note: in expansion of macro 'PTR_EQUAL'
  189 |         res = PTR_EQUAL(tab, ptr, hash_val, key);                   \
      |               ^~~~~~~~~
st.c:889:9: note: in expansion of macro 'DO_PTR_EQUAL_CHECK'
  889 |         DO_PTR_EQUAL_CHECK(tab, &entries[i], hash_value, key, eq_p, rebuilt_p);
      |         ^~~~~~~~~~~~~~~~~~
st.c: In function 'find_table_entry_ind':
st.c:180:40: error: too many arguments to function '(int (*)(void))tab->type->compare'; expected 0, have 2
  180 | #define EQUAL(tab,x,y) ((x) == (y) || (*(tab)->type->compare)((x),(y)) == 0)
      |                                       ~^~~~~~~~~~~~~~~~~~~~~~ ~~~
st.c:182:35: note: in expansion of macro 'EQUAL'
  182 |     ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key))
      |                                   ^~~~~
st.c:189:15: note: in expansion of macro 'PTR_EQUAL'
  189 |         res = PTR_EQUAL(tab, ptr, hash_val, key);                   \
      |               ^~~~~~~~~
st.c:931:13: note: in expansion of macro 'DO_PTR_EQUAL_CHECK'
  931 |             DO_PTR_EQUAL_CHECK(tab, &entries[bin - ENTRY_BASE], hash_value, key, eq_p, rebuilt_p);
      |             ^~~~~~~~~~~~~~~~~~
st.c: In function 'find_table_bin_ind':
st.c:180:40: error: too many arguments to function '(int (*)(void))tab->type->compare'; expected 0, have 2
  180 | #define EQUAL(tab,x,y) ((x) == (y) || (*(tab)->type->compare)((x),(y)) == 0)
      |                                       ~^~~~~~~~~~~~~~~~~~~~~~ ~~~
st.c:182:35: note: in expansion of macro 'EQUAL'
  182 |     ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key))
      |                                   ^~~~~
st.c:189:15: note: in expansion of macro 'PTR_EQUAL'
  189 |         res = PTR_EQUAL(tab, ptr, hash_val, key);                   \
      |               ^~~~~~~~~
st.c:978:13: note: in expansion of macro 'DO_PTR_EQUAL_CHECK'
  978 |             DO_PTR_EQUAL_CHECK(tab, &entries[bin - ENTRY_BASE], hash_value, key, eq_p, rebuilt_p);
      |             ^~~~~~~~~~~~~~~~~~
st.c: In function 'find_table_bin_ptr_and_reserve':
st.c:180:40: error: too many arguments to function '(int (*)(void))tab->type->compare'; expected 0, have 2
  180 | #define EQUAL(tab,x,y) ((x) == (y) || (*(tab)->type->compare)((x),(y)) == 0)
      |                                       ~^~~~~~~~~~~~~~~~~~~~~~ ~~~
st.c:182:35: note: in expansion of macro 'EQUAL'
  182 |     ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key))
      |                                   ^~~~~
st.c:189:15: note: in expansion of macro 'PTR_EQUAL'
  189 |         res = PTR_EQUAL(tab, ptr, hash_val, key);                   \
      |               ^~~~~~~~~
st.c:1086:13: note: in expansion of macro 'DO_PTR_EQUAL_CHECK'
 1086 |             DO_PTR_EQUAL_CHECK(tab, &entries[entry_index - ENTRY_BASE], curr_hash_value, key, eq_p, rebuilt_p);
      |             ^~~~~~~~~~~~~~~~~~
st.c: In function 'st_general_foreach':
st.c:1626:19: error: too many arguments to function 'func'; expected 0, have 4
 1626 |         retval = (*func)(key, curr_entry_ptr->record, arg, 0);
      |                  ~^~~~~~ ~~~
st.c:1655:27: error: too many arguments to function 'func'; expected 0, have 4
 1655 |                 retval = (*func)(0, 0, arg, 1);
      |                          ~^~~~~~ ~
make[2]: *** [Makefile:997: st.lo] Error 1

Can be easily reproduced with:

$ dnf install -y git-core make gcc automake libtool cmp gawk && \
git clone https://github.com/k-takata/Onigmo && cd Onigmo/ && \
sh autogen.sh && ./configure && make CFLAGS="-Wno-incompatible-pointer-types"
@mikelolasagasti
Copy link
Author

It can be built with:

 CFLAGS="-std=gnu17" ./configure && make CFLAGS="-Wno-incompatible-pointer-types"

GCC15 has C language with gnu23 by default and has stricter checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant