#!/bin/sh
# $Id: gcc-stricter,v 1.9 2018/08/11 12:41:21 tom Exp $
#
# _CONST_X_STRING is my own ifdef to X11/Intrinsic.h, to make
# typedef const char *String;
# Doing that will help me make the "const" strings in xterm, xvile match with X.
#
# I also changed X11/XResource.h to use _Xconst in XrmOptionDescRec.
#
OPTS=
VERS=`gcc --version 2>/dev/null |head -n 1 | sed -e 's/[[:space:]]*$//' -e 's/[[:space:]]\{1,\}[[:digit:]]\{8,8\}$//' -e 's/^.*[[:space:]]//'`
case x$VERS in
x[5-9].[0-9]*.*[0-9])
OPTS='-Wformat -Werror=format-security -fstack-protector-strong'
;;
x)
gcc --version
exit 1
;;
esac
gcc-strict \
-D_CONST_X_STRING \
-D_FORTIFY_SOURCE=2 \
$OPTS "$@"