From 3469ae808543e31ab3bd77358fb87820d6d26e07 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 8 Apr 2004 15:38:43 +0000 Subject: (sc_dd_max_sym_length): New target. (syntax-check-rules): Add it. --- Makefile.maint | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile.maint b/Makefile.maint index efa14d1f2..44a93f9a7 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -70,6 +70,7 @@ syntax-check-rules = \ sc_cast_of_x_alloc_return_value \ sc_cast_of_alloca_return_value \ sc_changelog \ + sc_dd_max_sym_length \ sc_error_exit_success \ sc_prohibit_atoi_atof \ sc_space_tab \ @@ -149,6 +150,21 @@ sc_changelog: { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ exit 1; } || : +# Ensure that dd's definition of LONGEST_SYMBOL stays in sync +# with the strings from the two affected variables. +dd_c = $(srcdir)/src/dd.c +sc_dd_max_sym_length: + len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c); \ + sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \ + |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \ + | wc --max-line-length); \ + max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \ + |tr -d '"' | wc --max-line-length); \ + if test "$$len" = "$$max"; then :; else \ + echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \ + exit 1; \ + fi + header_regexp = \ alloca\ |closeout\ -- cgit v1.2.3-70-g09d2