aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/c89
diff options
context:
space:
mode:
authorWolfgang Helbig <helbig@FreeBSD.org>1997-10-05 18:44:37 +0000
committerWolfgang Helbig <helbig@FreeBSD.org>1997-10-05 18:44:37 +0000
commitff0894cf3cdcd27c3a4f9aa5778427b596416396 (patch)
treea0761a192f8d4a129f4b92ed0d61b9d462f1dca2 /usr.bin/c89
parent4a3b1f84ff113611d299abe50833a85ceff44fad (diff)
downloadsrc-ff0894cf3cdcd27c3a4f9aa5778427b596416396.tar.gz
src-ff0894cf3cdcd27c3a4f9aa5778427b596416396.zip
Added -D_ANSI_SOURCE as discussed with bde,
removed bogus -trigraph (pointed out by bde), included check of operands (suggested by joerg)
Notes
Notes: svn path=/head/; revision=30128
Diffstat (limited to 'usr.bin/c89')
-rwxr-xr-xusr.bin/c89/c89.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/c89/c89.sh b/usr.bin/c89/c89.sh
index 735dc82199a0..a9ad3d0c35d0 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