home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!and!jos
- From: jos@and.nl (Jos Horsmeier)
- Newsgroups: comp.lang.c
- Subject: Re: strstr and ANSI-c
- Keywords: strstr ANSI
- Message-ID: <3359@dozo.and.nl>
- Date: 30 Aug 92 13:19:45 GMT
- References: <1992Aug29.215550.11490@daimi.aau.dk>
- Organization: AND Software BV Rotterdam
- Lines: 38
-
- In article <1992Aug29.215550.11490@daimi.aau.dk> pjunold@daimi.aau.dk (Peter Joachim Unold) writes:
- |Hello
- |
- |I've for some time been coding on a program, that must be compiled and run
- |on many diff. unix platforms. Apart from the usual portability problems one
- |encounter in unix-programming, I have had problems with users reporting, that
- |their ANSI-c compiler reports the 'strstr' string-function unknown. How is
- |that? strstr IS according to my K&C 2. edition part of the standard-library.
- |I could ofcause just code my own strstr function, but if one can't expect the
- |ANSI-c-compilers to fullfill the ANSI-standard, what can one expect?
-
- I assume you're distributing the _source code_ of your program to your
- users. Are you sure they're using an ANSI-C conformant compiler? The
- strstr() function is definitely part of the standard (paragraph 4.11.5.7)
- so ask your users to complain about it to their vendors.
-
- Did you check the `#include <string.h>' line in your source files?
- I think you probably did ...
-
- Maybe you could include some additional checkpoint sin your code. I've
- read about _non_ fonformant compilers that _do_ define __STDC__, but
- they define it as a non 1 value. Maybe some paranoic checks like
-
- #ifdef __STDC__
- #if __STDC__ != 1
- /* Include the same file here, just to cause the pre-processor
- * to start complaining, so you'll know something is wrong.
- * You can't use the #error statement here, 'cause the compiler
- * is cheating you ...
- */
- #endif
- #endif
-
- could help you out here ...
-
- kind regards,
-
- Jos aka jos@and.nl
-