]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: GCC-source: Disable gfc-format-internal recognition.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jun 2025 11:36:04 +0000 (13:36 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 19 Jun 2025 11:36:04 +0000 (13:36 +0200)
* gettext-tools/src/x-c.h (SCANNERS_C): Replace formatstring_gfc_internal with
NULL.
* gettext-tools/tests/format-gfc-internal-1: Remove file.
* gettext-tools/tests/Makefile.am (TESTS): Remove it.

gettext-tools/src/x-c.h
gettext-tools/tests/Makefile.am
gettext-tools/tests/format-gfc-internal-1 [deleted file]

index 2f64b8445fee1caffb62cbf8908fe19a2fa67629..ec13c75efdd3740dd11b4a2fcaa37f74790030bc 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext C/C++/ObjectiveC backend.
-   Copyright (C) 2001-2003, 2006, 2009, 2014-2015, 2018, 2020, 2023 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -52,7 +52,7 @@ extern "C" {
                         &formatstring_c, &formatstring_objc },          \
   { "GCC-source",       extract_c, NULL,                                \
                         &flag_table_gcc_internal,                       \
-                        &formatstring_gcc_internal, &formatstring_gfc_internal }, \
+                        &formatstring_gcc_internal, NULL },             \
 
 /* Scan a C file and add its translatable strings to mdlp.  */
 extern void extract_c (FILE *fp, const char *real_filename,
index 91b1e1ad03cb9329b7ec5cc9c5824a199fc3c6f1..babb917d75733050fc4888a8fa808922f3c6207e 100644 (file)
@@ -203,7 +203,7 @@ TESTS = gettext-1 gettext-2 \
        format-d-1 format-d-2 format-d-3 \
        format-elisp-1 format-elisp-2 format-elisp-3 \
        format-gcc-internal-1 format-gcc-internal-2 \
-       format-gfc-internal-1 format-gfc-internal-2 \
+       format-gfc-internal-2 \
        format-go-1 format-go-2 format-go-3 \
        format-java-1 format-java-2 \
        format-java-printf-1 format-java-printf-2 \
diff --git a/gettext-tools/tests/format-gfc-internal-1 b/gettext-tools/tests/format-gfc-internal-1
deleted file mode 100755 (executable)
index da26e76..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#! /bin/sh
-. "${srcdir=.}/init.sh"; path_prepend_ . ../src
-
-# Test recognition of GFC internal format strings.
-
-cat <<\EOF > f-gf-1.data
-# Valid: no argument
-"abc%%"
-# Valid: void argument
-"abc%C"
-# Valid: one locus argument
-"abc%L"
-# Valid: one character argument
-"abc%c"
-# Valid: one string argument
-"abc%s"
-# Valid: one integer argument
-"abc%i"
-# Valid: one integer argument
-"abc%d"
-# Valid: one integer argument
-"abc%u"
-# Valid: one argument with size specifier
-"abc%li"
-# Valid: one argument with size specifier
-"abc%ld"
-# Valid: one argument with size specifier
-"abc%lu"
-# Invalid: one argument with invalid size specifier
-"abc%lli"
-# Invalid: one argument with invalid size specifier
-"abc%llu"
-# Invalid: one argument with invalid size specifier
-"abc%ls"
-# Invalid: unterminated
-"abc%"
-# Invalid: unknown format specifier
-"abc%y"
-# Invalid: precision
-"abc%.*s"
-# Valid: three arguments
-"abc%d%u%u"
-# Valid: a numbered argument
-"abc%1$d"
-# Invalid: zero
-"abc%0$d"
-# Invalid: unterminated number
-"abc%1"
-# Valid: three arguments, two with same number
-"abc%1$i,%2$c,%1$d"
-# Invalid: argument with conflicting types
-"abc%1$i,%2$c,%1$u"
-# Valid: multiple uses of void argument
-"abc%Cdef%dghi%C"
-# Invalid: argument with conflicting types
-"abc%1$i,%2$c,%1$C"
-# Valid: mixing of numbered and unnumbered arguments
-"abc%d%2$u"
-# Invalid: missing non-final argument
-"abc%2$u%3$s"
-# Valid: non-final argument is void
-"abc%C%2$u%3$s"
-# Valid: permutation
-"abc%2$ddef%1$d"
-# Valid: multiple uses of same argument
-"abc%2$udef%1$sghi%2$u"
-EOF
-
-: ${XGETTEXT=xgettext}
-n=0
-while read comment; do
-  read string
-  n=`expr $n + 1`
-  cat <<EOF > f-gf-1-$n.in
-gettext(${string});
-EOF
-  ${XGETTEXT} -L GCC-source -o f-gf-1-$n.po f-gf-1-$n.in || Exit 1
-  test -f f-gf-1-$n.po || Exit 1
-  fail=
-  if echo "$comment" | grep 'Valid:' > /dev/null; then
-    if grep gfc-internal-format f-gf-1-$n.po > /dev/null; then
-      :
-    else
-      fail=yes
-    fi
-  else
-    if grep gfc-internal-format f-gf-1-$n.po > /dev/null; then
-      fail=yes
-    else
-      :
-    fi
-  fi
-  if test -n "$fail"; then
-    echo "Format string recognition error:" 1>&2
-    cat f-gf-1-$n.in 1>&2
-    echo "Got:" 1>&2
-    cat f-gf-1-$n.po 1>&2
-    Exit 1
-  fi
-  rm -f f-gf-1-$n.in f-gf-1-$n.po
-done < f-gf-1.data
-
-Exit 0