2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 # Find unused error function-names and reason-codes, and edit them
10 # out of the source. Doesn't handle line-wrapping, might have to do
11 # some manual cleanups to fix compile errors.
16 cd include/openssl || exit 1
17 grep '_[RF]_' * | awk '{print $3;}' | sort -u >$X1
20 for F in `cat $X1` ; do
21 git grep -l --full-name -F $F >$X2
23 test $NUM -gt 2 && continue
24 if grep -q $F crypto/err/openssl.ec ; then
25 echo Possibly unused $F found in openssl.ec
29 for FILE in `cat $X2` ; do
30 grep -v -w $F <$FILE >$FILE.new