view help/help_check.sh @ 36660:7fd255e0db1b

stream.c: remove pointless NULL check. Since it currently is a fixed-size array it can never be NULL. But even if this was changed, this check has no real value: it should still only be possible in case of an obvious code bug during development and the crash it would cause would be easy enough to debug.
author reimar
date Sun, 26 Jan 2014 18:59:15 +0000
parents 4df5cb727be4
children cb9975cda4bc
line wrap: on
line source

#!/bin/sh
# Check help message header files.

CHECK=checkhelp

trap "rm -f ${CHECK}.c ${CHECK}.o" EXIT

CC=$1
shift

for h in "$@"; do
  cat <<EOF > ${CHECK}.c
#include <inttypes.h>
#include <string.h>
#include "config.h"
#include "$h"
void $CHECK () {
EOF
  sed -n "s:^[ \t]*#define[ \t]\+\([0-9A-Za-z_]\+\)[ \t].*:strdup(\1);:p" "$h" >> ${CHECK}.c
  echo "}" >> ${CHECK}.c
  $CC -Werror -c -o ${CHECK}.o ${CHECK}.c || exit
done