Excerpts from Martin Liska's message of March 17, 2021 4:36 pm: > > gcc/d/ChangeLog: > > * d-builtins.cc (do_build_builtin_fn): Use startswith > function instead of strncmp. > * dmd/dinterpret.c (evaluateIfBuiltin): Likewise. > * dmd/dmangle.c: Likewise. > * dmd/hdrgen.c: Likewise. > * dmd/identifier.c (Identifier::toHChars2): Likewise. >
Hi, Sorry for just noticing, but the sources in dmd/ (unless noted otherwise) are maintained in an external repository. All changes must first go through there. That aside, the DMD front-end is meant to be a common implementation shared between two other compilers, therefore does not have any dependency on GCC itself. This patch changes that status quo. So without prejudice, I'll revert the changes to dmd/ only. There are, I note, a few other places in d/*.cc that use strncmp() but could instead use startswith(). d/d-incpath.cc:37:if (!strncmp (path, cpp_PREFIX, len)) d/d-incpath.cc:61:if (!strncmp (path, cpp_GCC_INCLUDE_DIR, len)) d/types.cc:877:gcc_assert (strncmp (ident, "__c_", strlen ("__c_")) == 0); > gcc/go/ChangeLog: > > * gofrontend/runtime.cc (Runtime::name_to_code): Use startswith > function instead of strncmp. > I might be wrong, but I'm pretty certain that Go is the same in having an external repository for these sources. Iain.