Index: mttroot/mtt/cc/sympar_txt2h.sh ================================================================== --- mttroot/mtt/cc/sympar_txt2h.sh +++ mttroot/mtt/cc/sympar_txt2h.sh @@ -1,8 +1,14 @@ #! /bin/sh # $Id$ # $Log$ +# Revision 1.7 2001/01/09 15:43:50 geraint +# Warn gcc that variables may be unused. +# +# Revision 1.6 2001/01/08 05:47:56 geraint +# Restrict scope of variables to file (static) +# # Revision 1.5 2000/12/05 12:44:55 peterg # Changed $() to `` # # Revision 1.4 2000/12/05 12:16:02 peterg # Changed function name to name() @@ -35,11 +41,11 @@ IN=${SYS}_sympar.txt OUT=${SYS}_sympar.h declare_sys_param () { -cat ${IN} | awk '{printf ("double %s;\t// %s\n", $1, $2)}' +cat ${IN} | awk '{printf ("static double %s MTT_UNUSED;\t// %s\n", $1, $2)}' } declare_temp_vars () { for name in ${TMP_VAR_NAMES} @@ -46,15 +52,26 @@ do echo "" i=0 while [ ${i} -le ${NUM_OF_TMP_VAR} ] do - echo "double ${name}${i};" + echo "static double ${name}${i} MTT_UNUSED;" i=`expr ${i} + 1` done done } echo Creating ${OUT} -declare_sys_param > ${OUT} +cat < ${OUT} +#ifndef MTT_UNUSED +#ifdef __GNUC__ +#define MTT_UNUSED __attribute__ ((__unused__)) +#else +#define MTT_UNUSED +#endif +#endif + +EOF + +declare_sys_param >> ${OUT} declare_temp_vars >> ${OUT}