tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

namespace pollution by curses



Hi,

pkgsrc/textproc/aspell crashes when linked to our curses (pkg/44005):
http://gnats.netbsd.org/44005

I've found that this is because curses uses a global variable "state":
https://nxr.netbsd.org/xref/src/lib/libcurses/getch.c#50
https://nxr.netbsd.org/xref/src/lib/libcurses/get_wch.c#52

If an application happens to have a global variable of the same name,
it is overridden by curses routines as a result. This is a scenario in
which aspell crashes.

I would like to propose renaming "state" into "_cursesi_state":
http://www.netbsd.org/~rin/curses_state_20190308.patch

Can I commit the patch? In that case, should I bump libcurses minor?
(That is, no matter to pull-up if minor version is bumped?)

Thanks,
rin


Home | Main Index | Thread Index | Old Index