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

3rd party module compatibility broken #1599

Closed
michaelortmann opened this issue Jun 1, 2024 · 0 comments · Fixed by #1600
Closed

3rd party module compatibility broken #1599

michaelortmann opened this issue Jun 1, 2024 · 0 comments · Fixed by #1600

Comments

@michaelortmann
Copy link
Member

michaelortmann commented Jun 1, 2024

#1585 changed struct memberlist:

https://github.com/eggheads/eggdrop/pull/1585/files#diff-57a16b1aab40a51784d03f39a2da18c09b36c8c6cefe8b506ad275b77a8a07b9L53

modules like stats.mod use memberlist->user:

https://github.com/michaelortmann/stats.mod/blob/c0e2646260ab93d2fb9b1d1d4d86880d10ed3347/egg_chancontrol.c#L44

and wont compile anymore:

gcc -fPIC -g -O2 -pipe -Wall -I. -I../../.. -I../../.. -I../../../src/mod  -DHAVE_CONFIG_H -I/usr/include -g3 -DDEBUG -DDEBUG_ASSERT -DDEBUG_MEM -DDEBUG_DNS  -DMAKING_MODS -c stats.c
In file included from core/core.c:95,
                 from stats.c:89:
./core/templates_stats_commands.c: In function ‘template_send_hosts’:
./core/templates_stats_commands.c:543:11: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘host + -1’ must not be NULL [-Waddress]
  543 |     if (!((host - 1) && host)) {
      |           ^
In file included from stats.c:101:
egg_chancontrol.c: In function ‘egg_check_chan_desynch’:
egg_chancontrol.c:44:73: error: ‘memberlist’ {aka ‘struct memstruct’} has no member named ‘user’
   44 |                                 schan_join(chan, m->nick, m->userhost, m->user ? m->user->handle : NULL);
      |                                                                         ^~
egg_chancontrol.c:44:83: error: ‘memberlist’ {aka ‘struct memstruct’} has no member named ‘user’
   44 |                                 schan_join(chan, m->nick, m->userhost, m->user ? m->user->handle : NULL);
      |                                                                                   ^~
make[2]: *** [Makefile:20: ../stats.o] Error 1
make[2]: Leaving directory '/home/michael/projects/eggdrop/src/mod/stats.mod'
make[1]: *** [Makefile:60: stats.mod_so] Error 2
make[1]: Leaving directory '/home/michael/projects/eggdrop/src/mod'
make: *** [Makefile:251: debug] Error 2

We need to document that breakage and suggest migrating m->user to get_user_from_member(m) in any 3rd party module (or alternatively revert / change the compatibility back)

vanosg pushed a commit that referenced this issue Jun 5, 2024
Found by: mortmann
Patch by: thommey
Fixes: #1599
michaelortmann pushed a commit to michaelortmann/eggdrop that referenced this issue Jun 13, 2024
Found by: mortmann
Patch by: thommey
Fixes: eggheads#1599
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

Successfully merging a pull request may close this issue.

1 participant