bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lib/string.h: "gcc-11" reports an error when compiling "groff"


From: Bjarni Ingi Gislason
Subject: lib/string.h: "gcc-11" reports an error when compiling "groff"
Date: Sat, 9 Oct 2021 01:43:04 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

[...]
  CC       src/devices/xditview/gxditview-device.o
  CC       src/devices/xditview/gxditview-draw.o
  CC       src/devices/xditview/gxditview-Dvi.o
In file included from /usr/include/X11/Intrinsic.h:61,
                 from /usr/include/X11/IntrinsicP.h:51,
                 from ../src/devices/xditview/Dvi.c:18:
./lib/string.h:965:1: error: expected ',' or ';' before '_GL_ATTRIBUTE_MALLOC'
  965 | _GL_FUNCDECL_SYS (strdup, char *,
      | ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:7260: src/devices/xditview/gxditview-Dvi.o] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:5886: all] Error 2

%%%%%

Operation system: Debian/Linux
glibc 2.32-4
Compiler: gcc-11 (Debian 11.2.0-8) 11.2.0
CFLAGS = CXXFLAGS = -g -O2 (default in Makefile)
GNULIB_NAMESPACE is not defined
GNULIB_POSIXCHECK is not defined
HAVE_RAW_DECL_STRDUP is not defined

%%%%%

Software: "groff" repository with latest GNULIB

  Relevant (?) part of "groff/build/lib/string.h"

   930  /* Duplicate S, returning an identical malloc'd string.  */
   931  #if 0
   932  # if 0
   933  #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   934  #   undef strdup
   935  #   define strdup rpl_strdup
   936  #  endif
   937  _GL_FUNCDECL_RPL (strdup, char *,
   938                    (char const *__s)
   939                    _GL_ARG_NONNULL ((1))
   940                    _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   941  _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
   942  # elif defined _WIN32 && !defined __CYGWIN__
   943  #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   944  #   undef strdup
   945  #   define strdup _strdup
   946  #  endif
   947  _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
   948  # else
   949  #  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
   950      /* strdup exists as a function and as a macro.  Get rid of the 
macro.  */
   951  #   undef strdup
   952  #  endif
   953  #  if (!1 || __GNUC__ >= 11) && !defined strdup
   954  _GL_FUNCDECL_SYS (strdup, char *,
   955                    (char const *__s)
   956                    _GL_ARG_NONNULL ((1))
   957                    _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   958  #  endif
   959  _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
   960  # endif
   961  _GL_CXXALIASWARN (strdup);
   962  #else
   963  # if __GNUC__ >= 11 && !defined strdup
   964  /* For -Wmismatched-dealloc: Associate strdup with free or rpl_free.  */
   965  _GL_FUNCDECL_SYS (strdup, char *,
   966                    (char const *__s)
   967                    _GL_ARG_NONNULL ((1))
   968                    _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
   969  # endif
   970  # if defined GNULIB_POSIXCHECK
   971  #  undef strdup
   972  #  if HAVE_RAW_DECL_STRDUP
   973  _GL_WARN_ON_USE (strdup, "strdup is unportable - "
   974                   "use gnulib module strdup for portability");
   975  #  endif
   976  # elif 1
   977  /* On native Windows, map 'creat' to '_creat', so that -loldnames is not
   978     required.  In C++ with GNULIB_NAMESPACE, avoid differences between
   979     platforms by defining GNULIB_NAMESPACE::strdup always.  */
   980  #  if defined _WIN32 && !defined __CYGWIN__
   981  #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
   982  #    undef strdup
   983  #    define strdup _strdup
   984  #   endif
   985  _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
   986  #  else
   987  #   if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
   988  #    undef strdup
   989  #   endif
   990  _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
   991  #  endif
   992  _GL_CXXALIASWARN (strdup);
   993  # endif
   994  #endif
   995  


-- 
Bjarni I. Gislason



reply via email to

[Prev in Thread] Current Thread [Next in Thread]