Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: cagney@gnu.org, gdb@sources.redhat.com
Subject: Re: Checking for minor-minor GCC version in testsuite
Date: Wed, 09 Jun 2004 15:49:00 -0000	[thread overview]
Message-ID: <20040609154939.5D11D4B104@berman.michael-chastain.com> (raw)

Andrew Cagney writes:
> Is there a way to check the minor-minor GCC version?

gcc provides __GNUC_PATCHLEVEL__ but the test suite doesn't use it.

In lib/compiler.c and lib/compiler.cc you could edit:

  -set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__} -]
  +set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ __GNUC_PATCH_LEVEL__} -]

Test before-and-after; for extra style, change the existing 39 calls
to test_compiler_info:

  gcc-2-*  gcc-2-*-*
  gcc-*-*  gcc-*-*-*
  et cetera

One gotcha: __GNUC_PATCHLEVEL__ is not available in gcc 2.95.3.  I think
this is okay because the compiler_info string will just expand to
"gcc-2-95-__GNUC_PATCHLEVEL__" so as long as no one is looking to
distinguish between gcc 2.95.2 and gcc 2.95.3 it's okay.  Tests for
"gcc-2-*" or "gcc-2-*-*" ought to work.  This gotcha will need a comment
though.  (The gcc doco for 3.3.3 says that __GNUC_PATCHLEVEL__ was
introduced with gcc 3.0 and also works in gcc 2.96 and gcc 2.97).

You could do this, or file a PR and I'll do it.

> The problem, present in gcc 3.3.2 appears to be fixed in gcc 3.3.3 (or 
> at least Red Hat's variant).

Or you could just cop out and treat all of gcc-3-3 as broken.

Andrew


             reply	other threads:[~2004-06-09 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 15:49 Michael Elizabeth Chastain [this message]
2004-06-09 16:05 ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2004-06-09 14:33 Andrew Cagney

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=20040609154939.5D11D4B104@berman.michael-chastain.com \
    --to=mec.gnu@mindspring.com \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    /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