[PATCH] Prefer strtok_r to strtok

Roland McGrath roland@redhat.com
Mon Nov 25 14:19:00 GMT 2002


> Humm, I see. From this point of view, strsep would be better?

strsep is a nonstandard extension like strdup and neither should really be
used by a strictly standard library.  If that is not a concern, strsep is
fine.  strtok_r is standard, so it is somewhat bogus to lose on systems
that don't have strsep but do have strtok_r (I don't know of any such).
An autoconf check and using strtok_r if available or strsep if available,
or providing a replacement from gnulib if there is one, would be the most
portable thing to do.



More information about the Libstdc++ mailing list