#1017 inline attributes are set incorrectly in _mingw.h

closed-fixed
nobody
2007-03-22
2007-03-22
Brian Ripley
No

I believe the attached patch is needed to include/_mingw.h in mingw-runtine-3.11.

This arose in testing the build of gcc (GCC) 4.3.0 20070315 (experimental) available from http://gcc.gnu.org/wiki/GFortranBinaries with -std=gnu99: any non-trivial project (e.g. R, www.r-project.org) gives rise to hundreds of multiple definitions.

There are two issues:

1) the documented attribute in the .texi files is
'gnu_inline' and not '__gnu__inline__' (and the doubled middle underscore seems a typo).

2) One can modify the behaviour of gcc via flags such as -fgnu89-inline, so it is not sufficient to check the gcc version and C status. There is a gcc macro (said to be available from gcc 4.1.3) that is defined when C99 inline semantics are in force, and only then does mingw-runtime need switching to the older GNU semantics for inline.

According to the .texi files, the macro is only defined when the attribute is available, so no other version test is needed. (We are talking about unreleased versions of gcc, though, but this seems unlikely to change.)

Discussion

  • Brian Ripley
    Brian Ripley
    2007-03-22

    patch for include/_mingw.h

     
    Attachments
  • Danny Smith
    Danny Smith
    2007-03-22

    • milestone: --> IINR_-_Include_In_Next_Release
    • status: open --> closed-fixed
     
  • Danny Smith
    Danny Smith
    2007-03-22

    Logged In: YES
    user_id=11494
    Originator: NO

    Thanks.
    The typo had already been corrected in CVS, but I've committed the second change ie, condition on #if __GNUC_STDC_INLINE__.

    Danny