2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (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.
23 echo Reason codes only
27 echo Function and reasons
30 echo "Usage error; one of -[efr] required."
35 cd include/openssl || exit 1
36 grep "$PAT" * | grep -v ERR_FATAL_ERROR | awk '{print $3;}' | sort -u >$X1
39 for F in `cat $X1` ; do
40 git grep -l --full-name -F $F >$X2
42 test $NUM -gt 2 && continue
43 if grep -q $F crypto/err/openssl.ec ; then
44 echo Possibly unused $F found in openssl.ec
48 for FILE in `cat $X2` ; do
49 grep -v -w $F <$FILE >$FILE.new