On Tue, Jan 13, 2015 at 3:50 AM, Mike Holmes <[email protected]> wrote: > From the man page > > "The strtok() function uses a static buffer while parsing, so it's not > thread safe. Use strtok_r() if this matters to you." > > I tested it and it appears to work fine as patched and I don't think we need > the arg parsing to be thread safe in this app as currently written.
It can be done either way, I only saw Mike's patch about _POSIX_C_SOURCE 200809L after I sent the patch. I also mistakenly thought the bug was assigned to me, that's why I worked on it, but it's still unclear what we are going to do with this bug. If we "fixed" stdc=c99 for good by defining POSIX source then we should clean all those bugs related to C99. > > > Mike > > On 12 January 2015 at 12:02, Mike Holmes <[email protected]> wrote: >> >> Agree that if it is in single threaded section we keep the possibility of >> including more than we want out by not defining POSIX. >> >> >> On 12 January 2015 at 10:47, Maxim Uvarov <[email protected]> wrote: >>> >>> On 01/12/2015 03:22 PM, Ola Liljedahl wrote: >>>> >>>> strtok() is not thread-safe and thus doesn't seem like a great idea to >>>> use it in a multithreaded application based on ODP. I don't know about >>>> this exact usage here, perhaps this argument parsing is always only >>>> going to happen in a single thread? >>> >>> parse_args() done before any threads init. So it's safe here. If strtok >>> is defined then >>> it's better to go with it then define POSIX. >>> >>> +1 For Ciprians solution. >>> >>> Maxim. >>> >>> >>> _______________________________________________ >>> lng-odp mailing list >>> [email protected] >>> http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> >> >> -- >> Mike Holmes >> Linaro Sr Technical Manager >> LNG - ODP > > > > > -- > Mike Holmes > Linaro Sr Technical Manager > LNG - ODP > > _______________________________________________ > lng-odp mailing list > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp > _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
