public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/51730] New: [4.7 Regression] autoconf 2.60 through 2.67 stdbool.h check fails with GCC 4.7
Date: Mon, 02 Jan 2012 12:13:00 -0000	[thread overview]
Message-ID: <bug-51730-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51730

             Bug #: 51730
           Summary: [4.7 Regression] autoconf 2.60 through 2.67 stdbool.h
                    check fails with GCC 4.7
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: jsm28@gcc.gnu.org


During a distro mass rebuild, I found that many packages still have configure
generated with autoconf 2.60 through 2.67, and these autoconf contain a not
strictly valid C:
         /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
            reported by James Lemley on 2005-10-05; see
           
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
            This test is not quite right, since xlc is allowed to
            reject this program, as the initializer for xlcbug is
            not one of the forms that C requires support for.
            However, doing the test right would require a runtime
            test, and that would make cross-compilation harder.
            Let us hope that IBM fixes the xlc bug, and also adds
            support for this kind of constant expression.  In the
            meantime, this test will reject xlc, which is OK, since
            our stdbool.h substitute should suffice.  We also test
            this with GCC, where it should work, to detect more
            quickly whether someone messes up the test in the
            future.  */
         char digs[] = "0123456789";
         int xlcbug = 1 / (&(digs + 5)[-2 + (_Bool) 1] == &digs[4] ? 1 : -1);
check.  Until http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172958
GCC has been accepting this though, and I suppose we don't want to fold array
refs that way when generating code.  Would it be possible to fold it that way
(try harder) just when we know we are not going to generate code based on it
(or when we know we'd error out otherwise)?  I know it sounds like an ugly
hack,
unfortunately autoconf 2.6[0-7] generated configure scripts are going to be
around for many years and the stdbool.h checks would fail in hundreds of
packages.


             reply	other threads:[~2012-01-02 12:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02 12:13 jakub at gcc dot gnu.org [this message]
2012-01-02 12:15 ` [Bug c/51730] " jakub at gcc dot gnu.org
2012-01-02 13:03 ` joseph at codesourcery dot com
2012-01-02 14:02 ` rguenth at gcc dot gnu.org
2012-01-02 14:16 ` rguenth at gcc dot gnu.org
2012-01-03  8:59 ` rguenth at gcc dot gnu.org
2012-01-03  9:01 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-51730-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).