When attempting to install twm version 1.0.5 on my Gentoo system, the build threw a quality-assurance warning: * menus.c:2374: warning: implicit declaration of function ‘putenv’ Same thing at line 2382. I'm not sure how to solve this yet, but perhaps something similar to lines 775-837 in util.c could be used? Duplication of that code probably won't be best though, so I recommend someone who knows what they're doing takes a look. :)
Still a problem in version 1.0.6.
Can't we just add #include <stdlib.h> to get the standard prototype for putenv()?
Actually, that shouldn't be needed - menus.c includes twm.h which includes <stdlib.h>, so it should be included already. It does appear glibc guards the definition with several #ifdefs, so someone who knows more about Linux header definitions will need to work out if this needs AC_SYSTEM_EXTENSIONS or something more specific.
> --- Comment #3 from Alan Coopersmith <alan.coopersmith@oracle.com> 2011-05-09 23:00:22 PDT --- > Actually, that shouldn't be needed - menus.c includes twm.h which includes > <stdlib.h>, so it should be included already. > > It does appear glibc guards the definition with several #ifdefs, so someone > who knows more about Linux header definitions will need to work out if this > needs AC_SYSTEM_EXTENSIONS or something more specific. > putenv is guarded by #if defined __USE_SVID || defined __USE_XOPEN in my copy. AC_USE_SYSTEM_EXTENSIONS sets _GNU_SOURCE, which turns on pretty much everything (in particular _XOPEN_SOURCE and _SVID_SOURCE, which in turn enable the above two), so that should work fine.
Fired up a VirtualBox image of Fedora 14, and tested, and these changes worked for me: http://patchwork.freedesktop.org/patch/5411/
Fix pushed to git master: http://cgit.freedesktop.org/xorg/app/twm/commit/?id=0f1ccd0b3409ab9b9fce1256fc59ad9bbe69a349
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.