From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95233 invoked by alias); 25 Oct 2016 00:51:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 95207 invoked by uid 89); 25 Oct 2016 00:51:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1719, weaves, late X-HELO: mail-qk0-f179.google.com Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Oct 2016 00:51:29 +0000 Received: by mail-qk0-f179.google.com with SMTP id w69so10949750qka.4 for ; Mon, 24 Oct 2016 17:51:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OHqjOET4Nu50G1pNmJrbqPqXNbXXldCPflpmR3vLmns=; b=Rj4fs9U9lKJCvIcp3diphbFoVHxZj+suJT0slLvt3rfzQIs/FQHvXryfxtkPYJp//G magj5QuYxG0q1fHNxm0R/9SamC6uTgy8vqJ/bkusrEQ1+70zQCeSzg3oLaBHDAonFnUt mdw+YR/8Bo1FcqFAnMOcFI4o0GCUbEH29qFdITPlQ4yXJt+ItVSdWa9p0LxGJChGUolm cPJW51/ZsfFN/K03fiwyhmT0EQ98JQmOdtDd0pQuxC4D4cM4U7nE1ZQlKOtn+fGRq5bg HPy6LZpeGCvqHoQhZpWCS51xB1v7gLTb5FaS0JpKleYAhC7bvj9Wv6oqvKp+l1m13vW3 0Z4A== X-Gm-Message-State: ABUngvcCRJxgaQCWABL9ZBz+k+vE4Oyw0GK/b0gFhBxx3qqbxFu/q48Py/zJ56AuzrQC/YGW5GUx6nahT9y1sQ== X-Received: by 10.55.151.70 with SMTP id z67mr18690597qkd.185.1477356688037; Mon, 24 Oct 2016 17:51:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.131.225 with HTTP; Mon, 24 Oct 2016 17:51:24 -0700 (PDT) In-Reply-To: <9a7ac4b5-2f5c-916c-a52e-c94e64d6f4f0@redhat.com> References: <01ba546d-060d-8591-9c5a-84d4bda2af22@redhat.com> <9a7ac4b5-2f5c-916c-a52e-c94e64d6f4f0@redhat.com> From: David Edelsohn Date: Tue, 25 Oct 2016 00:51:00 -0000 Message-ID: Subject: Re: GDB AIX build broken To: Pedro Alves Cc: GDB Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-10/txt/msg00682.txt.bz2 On Mon, Oct 24, 2016 at 8:31 PM, Pedro Alves wrote: > On 10/25/2016 01:13 AM, David Edelsohn wrote: >> On Mon, Oct 24, 2016 at 7:00 PM, Pedro Alves wrote: >> >>> That's a hint, but it can't be the fix. common-defs.h must be the >>> first file included. I suspect that gnulib's inttypes.h >>> replacement logic is broken on AIX. >> >> The gnulib import definitely is the commit that caused the breakage. gnulib weaves between its header files and the system header files in dangerous ways. It incorrectly assumes that it's version of a header file always will be seen before a system header file. But a system header file may include another system header file directly. AIX inttypes.h protects the printf format macros with #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) gnulib inttypes.h helpfully provides /* Some pre-C++11 implementations need this. */ # if defined __cplusplus && ! defined __STDC_FORMAT_MACROS # define __STDC_FORMAT_MACROS 1 # endif # include_next # endif #endif However, the first header file included by buffer.c is common-defs.h. common-defs.h includes stdio.h, which includes gnulib stdio.h #include_next Now we're in AIX stdio.h. AIX stdio.h includes sys/types.h. AIX sys/types.h includes inttypes.h. Bam. We now have included AIX inttypes.h without __STDC_FORMAT_MACROS defined. Later when gnulib inttypes.h explicitly is included, with __STDC_FORMAT_MACROS defined, it's too late because inttypes.h is protected from multiple inclusion. Should __STDC_FORMAT_MACROS be defined in gdb/common/common-defs.h and gdb/defs.h (if btrace.c also is changed)? Thanks, David