Home | History | Annotate | Download | only in mkdep
History log of /src/usr.bin/mkdep/findcc.h
RevisionDateAuthorComments
 1.3  20-Aug-2021  rillig mkdep: make argument of findcc const

Previously, findcc modified its argument string, even though it had been
declared as 'const char *'. This triggered a lint warning that "strchr
effectively discards 'const char *' from argument", in fact, this code
caused the lint check to be implemented in the first place.

The first attempt at fixing it by removing the 'const' from the
parameter type was a bad idea since it made the API of that function
more complicated.

Revert back to making the parameter a 'const char *' and duplicate that
string internally as necessary. Add a few more tests for absolute
pathnames since these had been missing before. There are no tests yet
for snprintf with too long strings, but the current change does not
modify that part of the code.
 1.2  19-Aug-2021  rillig mkdep: fix prototype of findcc

A function that modifies a string argument must not declare that
argument as 'const char *', even if all callers (mkdep and lint) always
pass it a modifiable string.

No functional change.
 1.1  14-Jun-2002  simonb Split out the findcc() function that tries to determine the path to
the C compiler so other programs can use it.

RSS XML Feed