Add __GNUC_PATCHLEVEL__

Jeffrey A Law law@cygnus.com
Mon Oct 18 01:21:00 GMT 1999


  In message <37557364.F9AA007D@cygnus.co.uk>you write:
  > This is a multi-part message in MIME format.
  > --------------3E307D92F875B35F0C14BB47
  > Content-Type: text/plain; charset=us-ascii
  > Content-Transfer-Encoding: 7bit
  > 
  > The granularity of __GNUC__ and __GNUC_MINOR__ is not fine enough. Here is 
  > a
  > patch that will add support for an additional macro __GNUC_PATCHLEVEL__
  > which is simply the next appropriate number in the version string, if
  > present. I have made it default to "0" if it isn't present.
  > 
  > So e.g. 2.95 would have __GNUC__==2, __GNUC_MINOR__==95 and
  > __GNUC_PATCHLEVEL__==0
  > 2.95.1 would have __GNUC__==2, __GNUC_MINOR__==95 and __GNUC_PATCHLEVEL__==
  > 1
  > 
  > Is this reasonable? If so, I'd be grateful if someone could check it in.
  > 
  > Jifl
  > 
  > Wed Jun  2 17:34:42 1999  Jonathan Larmour  <jlarmour@cygnus.co.uk>
  > 
  >         * gcc.c (default_compilers): Add new __GNUC_PATCHLEVEL__ define to
  >         default cpp spec
  >         * gcc.c (do_spec_1): Add support for %v3 spec used by
  >         __GNUC_PATCHLEVEL__
Based on follow-up discussions [which I can't immediately find] I've changed
my mind about the utility of having a GNUC_PATCHLEVEL macro.

However, we also want to make sure that other front-ends are providing
a patchlevel macro too -- chill, c++, objc & fortran are all providing
major/minor, so they should also provide patchlevel.  java doesn't seem to
provide any version info; presumably that is by design, not accident :-)

So, I think you need to update the various lang-specs files in the language
front-end directories, then install your patch.

Sorry it took so long to get back to this.

jeff





More information about the Gcc-patches mailing list