This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19582] strtok and strtok_r do not work without -fwritable-strings
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2005 03:00:12 -0000
- Subject: [Bug c/19582] strtok and strtok_r do not work without -fwritable-strings
- References: <20050123025709.19582.roger@systemroot.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-23 03:00 -------
This is invalid, see the prototype for strtok{,_r}:
strtok_r(char *str, const char *sep, char **last);
And from the man page (from *BSD, well from darwin):
The strtok() function is used to isolate sequential tokens in a null-ter-
minated string, str.
So you need a writable string.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19582