From 692805a7ce651526f13684e8ec56221dd3f75d1a Mon Sep 17 00:00:00 2001 From: helbig Date: Sun, 5 Oct 1997 18:44:37 +0000 Subject: Added -D_ANSI_SOURCE as discussed with bde, removed bogus -trigraph (pointed out by bde), included check of operands (suggested by joerg) --- usr.bin/c89/c89.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'usr.bin/c89') diff --git a/usr.bin/c89/c89.sh b/usr.bin/c89/c89.sh index 735dc82..a9ad3d0 100755 --- a/usr.bin/c89/c89.sh +++ b/usr.bin/c89/c89.sh @@ -24,7 +24,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# $Id: c89.sh,v 1.1.1.1 1997/09/17 20:44:53 joerg Exp $ +# $Id: c89.sh,v 1.2 1997/09/18 20:55:50 joerg Exp $ # # This is the Posix.2 mandated C compiler. Basically, a hook to the # cc(1) command. @@ -36,6 +36,8 @@ usage() exit 64 } +_PARAMS="$@" + while getopts "cD:EgI:L:o:OsU:" opt do case $opt in @@ -47,11 +49,25 @@ do esac done -if [ $(($OPTIND - 1)) = $# ] +shift $(($OPTIND - 1)) + +if [ $# = "0" ] then echo "Missing operand" 1>&2 usage fi -exec cc -ansi -pedantic -trigraphs "$@" +while [ $# != "0" ] +do + case $1 in + -l* | *.a | *.c | *.o) + shift + ;; + *) + echo "Invalid operand" 1>&2 + usage + ;; + esac +done +exec cc -ansi -pedantic -D_ANSI_SOURCE $_PARAMS -- cgit v1.1