Bug 47792

Summary: luit 1.1.1 fails with new util-macros with gcc but succeeds with clang
Product: xorg Reporter: roberth <sarvatt>
Component: App/luitAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: jcristau
Version: 7.7 (2012.06)   
Hardware: Other   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=415949
Whiteboard:
i915 platform: i915 features:

Description roberth 2012-03-23 22:32:57 UTC
with macros 1.17.0 and gcc

make  all-recursive
make[1]: Entering directory `/home/sarvatt/source/luit'
Making all in man
make[2]: Entering directory `/home/sarvatt/source/luit/man'
  GEN    luit.1
make[2]: Leaving directory `/home/sarvatt/source/luit/man'
make[2]: Entering directory `/home/sarvatt/source/luit'
  CC     charset.o
  CC     iso2022.o
  CC     locale.o
  CC     luit.o
  CC     other.o
  CC     parser.o
  CC     sys.o
sys.c: In function ‘allocatePty’:
sys.c:339:5: warning: implicit declaration of function ‘posix_openpt’ [-Wimplicit-function-declaration]
sys.c:339:5: warning: nested extern declaration of ‘posix_openpt’ [-Wnested-externs]
  CCLD   luit
make[2]: Leaving directory `/home/sarvatt/source/luit'
make[1]: Leaving directory `/home/sarvatt/source/luit'

With macros 1.15.0 where it succeeds

make  all-recursive
make[1]: Entering directory `/home/tinderbox/xorg/app/luit'
Making all in man
make[2]: Entering directory `/home/tinderbox/xorg/app/luit/man'
  GEN    luit.1
make[2]: Leaving directory `/home/tinderbox/xorg/app/luit/man'
make[2]: Entering directory `/home/tinderbox/xorg/app/luit'
  CC     charset.o
  CC     iso2022.o
  CC     locale.o
  CC     luit.o
  CC     other.o
  CC     parser.o
  CC     sys.o
sys.c: In function 'allocatePty':
sys.c:339: warning: implicit declaration of function 'posix_openpt'
sys.c:339: warning: nested extern declaration of 'posix_openpt'
  CCLD   luit
make[2]: Leaving directory `/home/tinderbox/xorg/app/luit'
make[1]: Leaving directory `/home/tinderbox/xorg/app/luit'


with this is the build succeeds with gcc

diff --git a/sys.c b/sys.c
index 8463b05..5bf0491 100644
--- a/sys.c
+++ b/sys.c
@@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#define _XOPEN_SOURCE 600
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif

also passing --disable-selective-werror to configure with util-macros 1.16.1+ succeeds. Is there any way this -Werror stuff in util-macros can be opt-in instead of opt-out by default? Is breaking previous tarball releases with macro updates the way to go? macros being backwards compatible was seemingly implicit in the past, breaking older releases seems strange to me and will mean the linux distro I use can't backport it so people can build new driver releases without building macros themselves anymore.
Comment 1 Thomas E. Dickey 2013-01-05 13:33:15 UTC
The Xorg configure script differs enough from upstream source
(and is deficient in so many respects), and it can only be
regarded by me as wholly unsupported.
Comment 2 Alan Coopersmith 2013-07-13 06:45:42 UTC
For whatever reason, the configure script forces an older XOPEN_VERSION
on Linux:

    linux*)
        AC_CHECK_HEADERS([poll.h])
        AC_CHECK_FUNCS([poll])
        OS_CFLAGS="-D_XOPEN_SOURCE=500"

This seems to be from this commit, for which 500 was the minimum value:
http://cgit.freedesktop.org/xorg/app/luit/commit/?id=e1a002217cabdb0806f28a0530a9cb972f370312
perhaps it needs to be bumped to 600 now?

Or can we just replace it altogether with AC_USE_SYSTEM_EXTENSIONS now?
Comment 3 Julien Cristau 2013-07-13 08:18:24 UTC
> --- Comment #2 from Alan Coopersmith <alan.coopersmith@oracle.com> ---
> Or can we just replace it altogether with AC_USE_SYSTEM_EXTENSIONS now?
> 
that sounds like the way to go.
Comment 4 Alan Coopersmith 2013-07-13 16:45:54 UTC
Patch submitted for review:
http://patchwork.freedesktop.org/patch/14052/
Comment 5 Alan Coopersmith 2015-08-08 04:24:26 UTC
Oops, forgot to mark this as fixed when the patch was pushed to git two years
ago:

http://cgit.freedesktop.org/xorg/app/luit/commit/?id=800f55f8dcd195dd0cdfc1c4d7487d00bb7745f4

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.