Patch to projects.html: glibc's string function macros

Joseph S. Myers
Mon Oct 30 16:27:00 GMT 2000

On Mon, 30 Oct 2000, Kaveh R. Ghazi wrote:

> Done and done.  Since va_end isn't broken, I didn't bother with a
> testcase.

va_end was, however, broken in 2.95.2, which is a (weak) case for adding a
testcase for it anyway.

> On another matter, I whipped up a patch for a builtin strstr based on
> the desciption you posted to the "projects" page.
> I can do some of the others, but for now how's this?  It converts:
> strstr(s1, "") -> s1
> strstr(s1, "c") -> strchr(s1, c)
> other calls to strstr are untouched.

Assuming it's been tested to work (in which case, there should be a
testcase added to gcc.dg (a) testing correct execution of both cases; (b)
using scan-assembler-not to make sure that the references to strstr were
optimized away), it seems fine to me, and obsoletes that particular glibc
macro.  (Of course, the web page should be updated as well once this is
approved and in GCC.)

(I think GCC should have as thorough a testsuite as possible - whenever a
bug is fixed, a testcase should be installed if one is available or can
readily be constructed that doesn't have copyright problems; whenever a
feature that isn't completely trivial (including any new warning) and can
be tested is added, a testcase should be added.)

Joseph S. Myers

More information about the Gcc-patches mailing list