On Tue, Nov 1, 2011 at 7:58 PM, Kai Tietz <[email protected]> wrote:
> 2011/11/1 Ozkan Sezer <[email protected]>:
>> On Tue, Nov 1, 2011 at 7:11 PM, Ozkan Sezer <[email protected]> wrote:
>>> On Tue, Nov 1, 2011 at 5:13 PM, Komisar <[email protected]> wrote:
>>>> Also I see lot of
>>>> "stdio.h:287:28: warning: inline function 'vsnprintf' declared but never
>>>> defined [enabled by default]"
>>>> Warnings when compiling mingw-w64-crt
>>>> http://komisar.gin.by/test/ugh.txt
>>>>
>>>> From: Komisar [mailto:[email protected]]
>>>> Sent: Tuesday, November 01, 2011 5:54 PM
>>>> To: '[email protected]'
>>>> Subject: stdio.h problem
>>>>
>>>> I think something wrong with last commit 2011-10-31.
>>>> Not sure about correctness this of the patch but review it.
>>>> http://komisar.gin.by/test/stdio.h.diff
>>>>
>>>
>>> Indeed, the lines you touched seem broken.  *Possibly* better
>>> patch below, using __MINGW_ATTRIB_NONNULL macro for consistency
>>> and adding __restict__ to args 1 and 2 and also marked as nothrow
>>> the asprintf and vasprintf (JonY, Kai: verify.)
>>>
>>> --- stdio.h.orig
>>> +++ stdio.h
>>> @@ -162,11 +162,11 @@ extern
>>>   __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
>>>   int __cdecl __mingw_vsprintf (char * __restrict__ , const char *
>>> __restrict__ , va_list) __MINGW_NOTHROW;
>>>  extern
>>> -  __attribute__ ((format (gnu_printf, 2, 3))) __attribute__((nonnull 
>>> (1,2))) __
>>> -  int __cdecl mingw_asprintf(char **ret, const char *format, ...);
>>> +  __attribute__((__format__ (gnu_printf, 2, 3))) 
>>> __MINGW_ATTRIB_NONNULL(1,2)
>>> +  int __cdecl __mingw_asprintf(char ** __restrict__ , const char *
>>> __restrict__ , ...) __MINGW_NOTHROW;
>>>  extern
>>> -  __attribute__ ((format (gnu_printf, 2, 0))) __attribute__((nonnull 
>>> (1,2))) __
>>> -  int __cdecl mingw_vasprintf(char **ret, const char *format, va_list ap);
>>> +  __attribute__((__format__ (gnu_printf, 2, 0))) 
>>> __MINGW_ATTRIB_NONNULL(1,2)
>>> +  int __cdecl __mingw_vasprintf(char ** __restrict__ , const char *
>>> __restrict__ , va_list) __MINGW_NOTHROW;
>>>
>>>  #if __USE_MINGW_ANSI_STDIO
>>>  /*
>>> @@ -284,7 +284,7 @@ int vsnprintf (char *__stream, size_t __
>>>  # undef vsnprintf
>>>   int __cdecl snprintf(char * __restrict__ s, size_t n, const char *
>>> __restrict__  format, ...);
>>>  #ifndef __CRT__NO_INLINE
>>> -  __CRT__INLINE int __cdecl vsnprintf(char * __restrict__
>>> _DstBuf,size_t _MaxCount,const char * __restrict__ _Format,va_list
>>> _ArgList) __MINGW_ATTRIB_DEPRECATED_MSVC2005
>>> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>>> +  __CRT_INLINE int __cdecl vsnprintf(char * __restrict__
>>> _DstBuf,size_t _MaxCount,const char * __restrict__ _Format,va_list
>>> _ArgList) __MINGW_ATTRIB_DEPRECATED_MSVC2005
>>> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>>>  #endif /* __CRT__NO_INLINE */
>>>  #pragma pop_macro ("vsnprintf")
>>>  #pragma pop_macro ("snprintf")
>>>
>>>
>>> As for the warnings you mention: Do you see them _after_ applying
>>> your fix?
>>
>> Hmm, OK, adding a
>> #define __CRT__NO_INLINE
>> at top of mingw-w64-crt/stdio/asprintf.c before the includes should
>> take of that warning I think.
>>
>>>
>>> --
>>> O.S.
>>>
>>
>> --
>> O.S.
>
> I fixed issue at  revision 4564.
>

The extra "__" in asprintf() and vasprintf() prototypes are still
there (are they
supposed to serve some purpose?).  The __CRT__INLINE typo (note the "__"
after __CRT should be "_") is still there.

Attached a patch (untested).

> Kai
>

--
O.S.

Attachment: stdio.diff
Description: Binary data

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to