[vlc-devel] commit: strerror(errno) is not thread-safe, use %m ( Rémi Denis-Courmont )

Måns Rullgård mans at mansr.com
Wed Oct 7 20:37:19 CEST 2009

Rafael Carre <rafael.carre at gmail.com> writes:

> Le Wed, 07 Oct 2009 10:11:05 +0200,
> Anthony Loiseau <thannoy at actech-innovation.com> a écrit :
>> Hi,
>> Just a note (I have not tested anything).
>> - strerror() conforms to C89,C99 and POSIX
> sure, but it just is not thread safe so you shouldn't use it in VLC

POSIX also has strerror_r(), which is thread safe.  That isn't C99

>> - isn't %m a GNU extension?
> Yes but VLC emulates it : see QueueMsg() in src/misc/messages.c

Given this, using %m makes perfect sense.

Måns Rullgård
mans at mansr.com

More information about the vlc-devel mailing list