#383 include/inttypes.h leaks inline declaration

closed-accepted
2009-07-18
2008-07-06
Gregory McGarry
No

include/inttypes.h declares an inline function without protection of __NO_INLINE__.

The solution is not universal in the headers, since some headers like string.h use __STRICT_ANSI__ and others use __NO_INLINE__ to avoid inline declarations in headers.

Discussion

  • patch to include/inttypes.h

     
    Attachments
  • Danny Smith
    Danny Smith
    2008-07-07

    Logged In: YES
    user_id=11494
    Originator: NO

    Why I is the __NO_INLINE__ guard necessary again? Is this a PCC requirement? If the GNU compiler defines __NO_INLINE__ then it will just use the extern definition anyway.

    Danny

     
  • Logged In: YES
    user_id=2134462
    Originator: YES

    I guess it was originally introduced for pre-c99 ansi compilers. Newer changes to mingw-runtime haven't preserved the __NO_INLINE__ guard.

    There are currently discussions on the pcc list that concludes that declaring an extern inline function in a header and later defining an external linkage in the same transactional unit is not c99 compliant. I am not sure I agree, but I need to __NO_INLINE__ to build the mingwex library.

    This file isn't the only header. I have attached a newer version of the patch for all headers.
    File Added: diff.txt

     
  • patch to all headers to guard inlines with NO_INLINE

     
    Attachments
  • Your patch has been accepted and is now commited to CVS. You should expect to see it in the next release.

     
    • assigned_to: nobody --> ir0nh34d
    • status: open --> closed-accepted