Summary: | TWM: menus.c:2374: warning: implicit declaration of function ‘putenv’ | ||
---|---|---|---|
Product: | xorg | Reporter: | Dan Wallis <mrdanwallis> |
Component: | App/twm | Assignee: | Xorg Project Team <xorg-team> |
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> |
Severity: | normal | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Dan Wallis
2010-12-28 01:59:40 UTC
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.