diff options
author | helbig <helbig@FreeBSD.org> | 1997-10-05 18:44:37 +0000 |
---|---|---|
committer | helbig <helbig@FreeBSD.org> | 1997-10-05 18:44:37 +0000 |
commit | 692805a7ce651526f13684e8ec56221dd3f75d1a (patch) | |
tree | a88fe3584c63fd9d17e33ae7291a16b813846317 | |
parent | 9ed8aa4c8ec236844db52261e1d8216abe799405 (diff) | |
download | FreeBSD-src-692805a7ce651526f13684e8ec56221dd3f75d1a.zip FreeBSD-src-692805a7ce651526f13684e8ec56221dd3f75d1a.tar.gz |
Added -D_ANSI_SOURCE as discussed with bde,
removed bogus -trigraph (pointed out by bde),
included check of operands (suggested by joerg)
-rwxr-xr-x | usr.bin/c89/c89.sh | 22 |
1 files changed, 19 insertions, 3 deletions
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 |