Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-05 Thread Bjarni Ingi Gislason
  The cause is an error in "Makefile.in" (lines folded):

lib/libgnu_a-malloca.o: lib/malloca.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(lib_libgnu_a_CFLAGS) $(CFLAGS) -MT
lib/libgnu_a-malloca.o -MD -MP -MF
lib/$(DEPDIR)/libgnu_a-malloca.Tpo -c -o lib/libgnu_a-malloca.o
`test -f 'lib/malloca.c' || echo '$(srcdir)/'`lib/malloca.c

$(lib_libgnu_a_CFLAGS) is put before $(CFLAGS).

  I have not found the place where such lines are constructed.



lib/unictype/bitmap.h, different signs of integers; with clang and groff

2024-02-03 Thread Bjarni Ingi Gislason
  CC   lib/uniwidth/libgnu_a-width.o
In file included from ../lib/uniwidth/width.c:51:
../lib/unictype/bitmap.h:31:14: warning: comparison of integers of
different signs: 'unsigned int' and 'const int' [-Wsign-compare]
  if (index1 < ((const int *) table)[0])
  ~~ ^ 
1 warning generated.




lib/malloca.c, different signs of integers; with clang and groff

2024-02-03 Thread Bjarni Ingi Gislason
  CC   lib/libgnu_a-malloca.o
../lib/malloca.c:61:38: warning: comparison of integers of
different signs: 'size_t' (aka 'unsigned long') and 'idx_t' (aka
'long') [-Wsign-compare]
  if (!ckd_add (, n, plus) && !xalloc_oversized (nplus, 1))
 ^~~
../lib/xalloc-oversized.h:62:33: note: expanded from macro
'xalloc_oversized'
# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
^
../lib/xalloc-oversized.h:33:8: note: expanded from macro
'__xalloc_oversized'
   < (n)))
   ^  ~
1 warning generated.




lib/time.in.h, ctime has portability problems; with clang and groff

2024-02-03 Thread Bjarni Ingi Gislason
  The gnulib module "ctime" declares "ctime" to be deprecated.

  "ctime" is not used in "groff".

  CC   lib/libgnu_a-openat-proc.o
In file included from ../lib/openat-proc.c:25:
In file included from ./lib/sys/stat.h:51:
./lib/time.h:1094:18: warning: ctime has portability problems -
use gnulib module ctime for portability [-Wuser-defined-warnings]
_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases -
"
 ^
./lib/time.h:956:1: note: from 'diagnose_if' attribute on 'ctime':
_GL_WARN_ON_USE (ctime, "ctime has portability problems - "
^~~
./lib/sys/select.h:593:19: note: expanded from macro
'_GL_WARN_ON_USE'
  __attribute__ ((__diagnose_if__ (1, message, "warning")))
  ^~
1 warning generated.




"mbsspn" and "mbschr" missing in some files in /lib/

2024-02-01 Thread Bjarni Ingi Gislason
  While experimenting using the module "posixcheck" included in
"groff" I got these warnings:

N.B.  Some lines are folded.

  CC   lib/libgnu_a-chdir-long.o
../lib/chdir-long.c: In function 'chdir_long':
../lib/chdir-long.c:129:23: warning: call to 'strspn' declared
with attribute warning: strspn cannot work correctly on character
strings in multibyte locales - use mbsspn if you care about
internationalization [-Wattribute-warning]
  129 | n_leading_slash = strspn (dir, "/");
  |   ^
In function 'find_non_slash',
inlined from 'chdir_long' at ../lib/chdir-long.c:152:15:
../lib/chdir-long.c:89:20: warning: call to 'strspn' declared
with attribute warning: strspn cannot work correctly on character
strings in multibyte locales - use mbsspn if you care about
internationalization [-Wattribute-warning]
   89 |   size_t n_slash = strspn (s, "/");
  |^~~
In function 'find_non_slash',
inlined from 'chdir_long' at ../lib/chdir-long.c:184:15:
../lib/chdir-long.c:89:20: warning: call to 'strspn' declared
with attribute warning: strspn cannot work correctly on character
strings in multibyte locales - use mbsspn if you care about
internationalization [-Wattribute-warning]
   89 |   size_t n_slash = strspn (s, "/");
  |^~~

-.-.

  CC   lib/libgnu_a-mbschr.o
../lib/mbschr.c: In function 'mbschr':
 ../lib/mbschr.c:68:12: warning: call to 'strchr' declared with
attribute warning: strchr cannot work correctly on character
strings in some multibyte locales - use mbschr if you care about
internationalization [-Wattribute-warning]
   68 | return strchr (string, c);
  |^~
  CC   lib/libgnu_a-mbsspn.o
../lib/mbsspn.c: In function 'mbsspn':
 ../lib/mbsspn.c:135:12: warning: call to 'strspn' declared with
attribute warning: strspn cannot work correctly on character
strings in multibyte locales - use mbsspn if you care about
internationalization [-Wattribute-warning]
  135 | return strspn (string, reject);
  |^~~

-.-

  CC   lib/libgnu_a-tempname.o
../lib/tempname.c: In function 'try_tempname_len':
../lib/tempname.c:230:10: warning: call to 'strspn' declared
with attribute warning: strspn cannot work correctly on character
strings in multibyte locales - use mbsspn if you care about
internationalization [-Wattribute-warning]
  230 |   || strspn ([len - x_suffix_len - suffixlen],
"X") < x_suffix_len)
  | 
^~~

-.-.

  It looks like "mbsspn" ("mbschr") needs to be selected in
these files (and others?) when the corresponding modules are
listed in "bootstrap.conf".



./lib/error.h:410:8: warning: ISO C forbids braced-groups within expressions [-Wpedantic]

2023-09-02 Thread Bjarni Ingi Gislason
While compiling "groff" with gcc (Debian 13.2.0-2) 13.2.0) and "-std=gnu2x":

../lib/openat-die.c: In function 'openat_save_fail':
./lib/error.h:410:8: warning: ISO C forbids braced-groups within expressions 
[-Wpedantic]
  410 |  : ({ \
  |^
./lib/error.h:470:7: note: in expansion of macro '__gl_error_call'
  470 |   __gl_error_call (error, status, __VA_ARGS__)
  |   ^~~
../lib/openat-die.c:37:3: note: in expansion of macro 'error'
   37 |   error (exit_failure, errnum,
  |   ^
../lib/openat-die.c: In function 'openat_restore_fail':
./lib/error.h:410:8: warning: ISO C forbids braced-groups within expressions 
[-Wpedantic]
  410 |  : ({ \
  |^
./lib/error.h:470:7: note: in expansion of macro '__gl_error_call'
  470 |   __gl_error_call (error, status, __VA_ARGS__)
  |   ^~~
../lib/openat-die.c:56:3: note: in expansion of macro 'error'
   56 |   error (exit_failure, errnum,
  |   ^

  The relevant code in lib/error.in.h is

/* If STATUS is a not a constant, the function call may or may not return;
   therefore -Wimplicit-fallthrough will produce a warning.  Use a compound
   statement in order to evaluate STATUS only once.
   If STATUS is a constant, we don't use a compound statement, because that
   would trigger a -Wimplicit-fallthrough warning even when STATUS is != 0,
   when not optimizing.  This causes STATUS to be evaluated twice, but
   that's OK since it does not have side effects.  */
# define __gl_error_call(function, status, ...) \
(__builtin_constant_p (status) \
 ? __gl_error_call1 (function, status, __VA_ARGS__) \
 : ({ \
 int const __errstatus = status; \
 __gl_error_call1 (function, __errstatus, __VA_ARGS__); \
   }))
#else




(lib/error.h.in) New warnings when compiling "groff" [-Wredundant-decls]

2023-05-29 Thread Bjarni Ingi Gislason
Debian GNU/Linux 12 (bookworm)
Linux 6.1.27-1 x86_64 GNU/Linux
gcc (Debian 12.2.0-14) 12.2.0

[...]
  CC   lib/libgnu_a-openat-die.o
In file included from ../lib/openat-die.c:25:
./lib/error.h:28:3: warning: #include_next is a GCC extension
   28 | # include_next 
  |   ^~~~
In file included from ../lib/openat.h:28,
 from ../lib/openat-die.c:20:
./lib/error.h:418:1: warning: redundant redeclaration of '_gl_cxxalias_dummy' 
[-Wredundant-decls]
  418 | _GL_CXXALIAS_SYS (error, void,
  | ^~~~
./lib/stdio.h:2266:1: note: previous declaration of '_gl_cxxalias_dummy' with 
type 'int'
 2266 | _GL_CXXALIASWARN (vsnprintf);
  | ^~~~
./lib/error.h:426:1: warning: redundant redeclaration of '_gl_cxxalias_dummy' 
[-Wredundant-decls]
  426 | _GL_CXXALIASWARN (error);
  | ^~~~
./lib/error.h:418:1: note: previous declaration of '_gl_cxxalias_dummy' with 
type 'int'
  418 | _GL_CXXALIAS_SYS (error, void,
  | ^~~~
./lib/error.h:455:1: warning: redundant redeclaration of '_gl_cxxalias_dummy' 
[-Wredundant-decls]
  455 | _GL_CXXALIAS_SYS (error_at_line, void,
  | ^~~~
./lib/error.h:426:1: note: previous declaration of '_gl_cxxalias_dummy' with 
type 'int'
  426 | _GL_CXXALIASWARN (error);
  | ^~~~
./lib/error.h:463:1: warning: redundant redeclaration of '_gl_cxxalias_dummy' 
[-Wredundant-decls]
  463 | _GL_CXXALIASWARN (error_at_line);
  | ^~~~
./lib/error.h:455:1: note: previous declaration of '_gl_cxxalias_dummy' with 
type 'int'
  455 | _GL_CXXALIAS_SYS (error_at_line, void,
  | ^~~~
./lib/error.h:468:15: warning: redundant redeclaration of 
'error_print_progname' [-Wredundant-decls]
  468 | extern void (*error_print_progname) (void);
  |   ^~~~
In file included from ./lib/error.h:28:
/usr/include/error.h:41:15: note: previous declaration of 
'error_print_progname' with type 'void (*)(void)'
   41 | extern void (*error_print_progname) (void);
  |   ^~~~
./lib/error.h:471:21: warning: redundant redeclaration of 'error_message_count' 
[-Wredundant-decls]
  471 | extern unsigned int error_message_count;
  | ^~~
/usr/include/error.h:44:21: note: previous declaration of 'error_message_count' 
with type 'unsigned int'
   44 | extern unsigned int error_message_count;
  | ^~~
./lib/error.h:475:12: warning: redundant redeclaration of 'error_one_per_line' 
[-Wredundant-decls]
  475 | extern int error_one_per_line;
  |^~
/usr/include/error.h:48:12: note: previous declaration of 'error_one_per_line' 
with type 'int'
   48 | extern int error_one_per_line;
  |^~
  CC   lib/libgnu_a-printf-frexp.o
[...] 



Re: lib/dirfd.c: compiler warning: unused parameter

2023-05-04 Thread Bjarni Ingi Gislason
On Thu, May 04, 2023 at 11:30:30AM +0200, Bruno Haible wrote:
> Paul Eggert wrote:
> > That being said, I see a path through lib/dirfd.c where dirfd's arg is 
> > ignored.
> 
> Yes, that may happen in systems that don't have d_fd nor dd_fd in 'DIR'
> and are not Windows. But such systems are of the 1980ies or 1990ies, and
> Gnulib does not support them any more.
> 
> I would not install the patch with _GL_UNUSED.
> 
  Paul Eggert asked in

https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00027.msg

Why did 'configure' decide to replace dirfd? 

###

  With "REPLACE_DIRFD=0" in gnulib/m4/dirfd.m4 :

  ...
  else
HAVE_DIRFD=1
dnl Replace only if the system declares dirfd already.
if test $ac_cv_have_decl_dirfd = yes; then
->  REPLACE_DIRFD=0 /* FIX ME, was =1 */
fi
dnl Replace dirfd() on native Windows, to support fdopendir().
AC_REQUIRE([gl_DIRENT_DIR])
if test $DIR_HAS_FD_MEMBER = 0; then
  REPLACE_DIRFD=1
fi
dnl OS/2 kLIBC dirfd() does not work.
case "$host_os" in
  os2*) REPLACE_DIRFD=1 ;;
esac



this is the result

checking for d_ino member in directory struct... yes
checking for dirfd... yes
checking whether dirfd is declared... yes
checking whether dirfd is a macro... no
../configure: 25974: ./configure.lineno: /bin: Permission denied
checking whether // is distinct from /... no

lrwxrwxrwx 1 root root 7 sep 21  2022 /bin -> usr/bin


  and the compilation is without the warning from the compiler.



Re: lib/dirfd.c: compiler warning: unused parameter

2023-05-03 Thread Bjarni Ingi Gislason
On Thu, May 04, 2023 at 01:59:07AM +0200, Bruno Haible wrote:
> Bjarni Ingi Gislason wrote:
> >   The compiler reports:
> > 
> >   CC   lib/libgnu_a-dirfd.o
> > ../lib/dirfd.c: In function 'rpl_dirfd':
> > ../lib/dirfd.c:83:13: warning: unused parameter 'dir_p'
> > [-Wunused-parameter]
> >83 | dirfd (DIR *dir_p)
> >   |~^
> 
> On which platform?
> 

File "/etc/os-release" shows

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"



lib/dirfd.c: compiler warning: unused parameter

2023-05-03 Thread Bjarni Ingi Gislason
Software: groff, private repository that is updated regulary with
GNU gnulib.

  with

gnulib_modules="
git-version-gen
havelib
wcwidth
fprintf-posix
snprintf
vsnprintf
stdint
  setlocale
  vsnprintf-posix
  warnings
  gen-header
  manywarnings
  mkstemp
  fmod
  getcwd
  putenv
  strcase
  strerror
  strtol
  stdckdint
  assert
  assert-h
  idx
  string
  strings
  nullptr
 "

  Changes in "lib/dirfd.c" this year are from commit 3f0950f65ab
(2023-04-27 01:42:25 +0200).

  The compiler reports:

  CC   lib/libgnu_a-dirfd.o
../lib/dirfd.c: In function 'rpl_dirfd':
../lib/dirfd.c:83:13: warning: unused parameter 'dir_p'
[-Wunused-parameter]
   83 | dirfd (DIR *dir_p)
  |~^
  CC   lib/libgnu_a-dirname-lgpl.o


  From the code, I can't see how the paremeter can not get used while
the code is traversed.



Re: adding gnulib's sys_wait module to groff made Automake angry

2023-04-17 Thread Bjarni Ingi Gislason
  This is groff bug #61832 (from 16th January 2022).

N.B. The subject line was changed.



groff with "nullptr" and (without) gnulib module causes error

2023-02-08 Thread Bjarni Ingi Gislason
Debian testing (bookworm/sid)

Linux  6.1.7-1  x86_64 GNU/Linux
 
gcc (Debian 12.2.0-14) 12.2.0

GNU Make 4.4.0.90
Built for x86_64-pc-linux-gnu



cd git/groff/src

grep -r -l nullptr * > $afrit

echo 's%0 /\* nullptr \*/%nullptr%' > ~/tmp/nullptr.sed

sed -i -f ~/tmp/nullptr.sed $(cat $afrit)

  Build with gnulib nullptr module or without it causes

  CXX  src/roff/troff/input.o
../src/roff/troff/input.cpp: In member function 'void token::next()':
../src/roff/troff/input.cpp:2078:18: error: invalid operands of types 'const 
char' and 'std::nullptr_t' to binary 'operator!='
 2078 |   if (*p != nullptr || s.is_empty()) {
  |   ~~~^~
make[1]: *** [Makefile:10126: src/roff/troff/input.o] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:6847: all] Error 2



"bootstrap.conf" with "nullptr"

gnulib_modules="
git-version-gen
havelib
manywarnings
wcwidth
fprintf-posix
gen-header
snprintf
vsnprintf-posix
warnings
  mkstemp
  fmod
  getcwd
  putenv
  strcase
  strerror
  strtol
  setlocale
  stdckdint
  assert
  assert-h
  idx
  string
  strings
  nullptr
 "



Re: FAIL in diffutils/gnulib-tests

2023-02-07 Thread Bjarni Ingi Gislason
On Mon, Feb 06, 2023 at 01:17:29AM +, Bjarni Ingi Gislason wrote:
[...]
> 
> FAIL: test-c-stack2.sh
> ==
> 
> FAIL test-c-stack2.sh (exit status: 1)
> 
> FAIL: test-localeconv
> =
> 
> ../../gnulib-tests/test-localeconv.c:53: assertion 'l->frac_digits == 
> CHAR_MAX' failed
> FAIL test-localeconv (exit status: 134)
> 

l->frac_digits is 127 and  CHAR_MAX is 255.

  This is due to the CFLAG "-funsigned-char", which I always use having
compiled "less", which produced a lot of warnings without this flag.

  The other two "FAIL" and opcode issues are still there.

[...]



Re: [g.branden.robin...@gmail.com: macOS 12.6.3 and vasnprintf compilation failure]

2023-02-06 Thread Bjarni Ingi Gislason


See https://savannah.gnu.org/bugs/index.php?63078

  I renamed the file "groff/src/include/assert.h" in my privat branch
of groff to ".../assert.h.original".



Differences between "module license" and "file license"

2023-02-06 Thread Bjarni Ingi Gislason
Debian testing (bookworm/sid)

  Compiling in the "build" directory:

/usr/local/bin/make
GNU Make 4.4.0.90
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
make check
Module LicenseFile License   File name
= == =
LGPLv2+   GPLlib/alignalloc.h
LGPLv2+   GPLlib/alignalloc.c
GPL   LGPLv2+lib/glob.c
GPL   LGPLv2+lib/glob_internal.h
GPL   LGPLv2+lib/glob_pattern_p.c
GPL   LGPLv2+lib/globfree.c
LGPLv2+   LGPLv3+ or GPLv2+ lib/uniwidth/width0.h
LGPLv2+   LGPLv3+ or GPLv2+ lib/uniwidth/width2.h
make: *** [Makefile:142: sc_check_copyright] Error 1



./check-copyright shows in the main (master) directory:

Module LicenseFile License   File name
= == =
LGPLv2+   GPLlib/alignalloc.h
LGPLv2+   GPLlib/alignalloc.c
GPL   LGPLv2+lib/glob.c
GPL   LGPLv2+lib/glob_internal.h
GPL   LGPLv2+lib/glob_pattern_p.c
GPL   LGPLv2+lib/globfree.c
LGPLv2+   LGPLv3+ or GPLv2+ lib/uniwidth/width0.h
LGPLv2+   LGPLv3+ or GPLv2+ lib/uniwidth/width2.h

with return status 1.



Re: FAIL in diffutils/gnulib-tests

2023-02-05 Thread Bjarni Ingi Gislason
On Mon, Feb 06, 2023 at 02:28:03AM +0100, Bruno Haible wrote:
> Bjarni Ingi Gislason wrote:
> >GNU diffutils 3.9.12-c05c: gnulib-tests/test-suite.log
> 
> Please try again with the tarball that you can download from
> https://gitlab.com/gnu-diffutils/ci-distcheck
> (full URL: 
> https://gitlab.com/gnu-diffutils/ci-distcheck/-/jobs/artifacts/main/raw/diffutils-snapshot.tar?job=check-optimized
>  ).
> 
[...]

Debian testing (bookworm/sid)

gcc (Debian 12.2.0-14) 12.2.0

GNU Make 4.4.0.90


  Differences between latest git repository and the tar file
"diffutils-2023-01-31".

  Similar text is shown on the terminal in both cases:

traps: test-c-stack[287115] trap invalid opcode ip:56214e4522af
sp:7ffde48af170 error:0 in test-c-stack[56214e452000+2000]

traps: test-sigsegv-ca[288174] trap invalid opcode ip:55f3cc5d047a
sp:7ffe4f87a9c0 error:0 in
test-sigsegv-catch-stackoverflow2[55f3cc5d+2000]

  The only difference concerning FAIL that I see is '>>' versus '>'.

-: from the git repository

+: the snapshot (tar file)


 PASS: test-locale
-../../build-aux/test-driver: line 112: 268125 Aborted
(core dumped) "$@" >> "$log_file" 2>&1
+../../build-aux/test-driver: line 107: 287758 Aborted
(core dumped) "$@" > $log_file 2>&1
 FAIL: test-localeconv
 PASS: test-lstat
 PASS: test-malloc-gnu
@@ -1734,7 +1734,7 @@ PASS: test-sigprocmask
 PASS: test-sigsegv-catch-segv1
 PASS: test-sigsegv-catch-segv2
 PASS: test-sigsegv-catch-stackoverflow1
-../../build-aux/test-driver: line 112: 268554 Illegal instruction
(core dumped) "$@" >> "$log_file" 2>&1
+../../build-aux/test-driver: line 107: 288174 Illegal instruction
(core dumped) "$@" > $log_file 2>&1
 FAIL: test-sigsegv-catch-stackoverflow2
 PASS: test-sleep



  There is a difference in code between the used test-drivers,
but they have the same scriptversion.

--- test-driver 2023-02-05 23:26:11.0 +
+++ /home/bg/Sottar.skrar/diffutils-2023-01-31/build-aux/test-driver   
2023-01-31 16:06:10.0 +
@@ -3,7 +3,7 @@

 scriptversion=2018-03-07.03; # UTC

-# Copyright (C) 2011-2021 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.



FAIL in diffutils/gnulib-tests

2023-02-05 Thread Bjarni Ingi Gislason
Latest master

locale is in /usr/share/i18n/locales/is_IS

% *_frac_* must be checked
int_frac_digits 0
frac_digits 0


   GNU diffutils 3.9.12-c05c: gnulib-tests/test-suite.log


# TOTAL: 204
# PASS:  169
# SKIP:  32
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

[...]

FAIL: test-c-stack2.sh
==

FAIL test-c-stack2.sh (exit status: 1)

FAIL: test-localeconv
=

../../gnulib-tests/test-localeconv.c:53: assertion 'l->frac_digits == CHAR_MAX' 
failed
FAIL test-localeconv (exit status: 134)

[...]

FAIL: test-sigsegv-catch-stackoverflow2
===

FAIL test-sigsegv-catch-stackoverflow2 (exit status: 132)



>From the make run

File make_variables:

WERROR_CFLAGS= 

/usr/local/bin/make
GNU Make 4.4.0.90
Built for x86_64-pc-linux-gnu

[...]

## -- ##
##  Gnulib tests  ##
## Please report test failures in this directory to . ##
## -- ##

[...]

FAIL: test-c-stack2.sh
[...]
PASS: test-locale
../../build-aux/test-driver: line 112: 272289 Aborted (core 
dumped) "$@" >> "$log_file" 2>&1
FAIL: test-localeconv
[...]
PASS: test-sigsegv-catch-stackoverflow1
../../build-aux/test-driver: line 112: 272705 Illegal instruction (core 
dumped) "$@" >> "$log_file" 2>&1
FAIL: test-sigsegv-catch-stackoverflow2
[...]





module c-nullptr: error compiling groff

2023-02-05 Thread Bjarni Ingi Gislason
Debian testing (bookworm/sid)

gcc (Debian 12.2.0-14) 12.2.0

GNU Make 4.4.0.90


[...]
  CXX  src/roff/troff/env.o
In file included from /usr/include/c++/12/bits/stl_bvector.h:61,
 from /usr/include/c++/12/vector:65,
 from ../src/roff/troff/charinfo.h:20,
 from ../src/roff/troff/env.cpp:31:
/usr/include/c++/12/bits/functional_hash.h:273:12: error: redefinition of 
'struct std::hash'
  273 | struct hash : public __hash_base
  |^~~
/usr/include/c++/12/bits/functional_hash.h:157:3: note: previous definition of 
'struct std::hash'
  157 |   _Cxx_hashtable_define_trivial_hash(long)
  |   ^~
make[1]: *** [Makefile:10126: src/roff/troff/env.o] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:6847: all] Error 2

modules in bootstrap.conf:

gnulib_modules="
git-version-gen
havelib
manywarnings
wcwidth
fprintf-posix
gen-header
snprintf
vsnprintf-posix
warnings
  mkstemp
  fmod
  getcwd
  putenv
  strcase
  strerror
  strtol
  setlocale
  stdckdint
  assert
  assert-h
  idx
  string
  strings
  c-nullptr
 "
#  c-nullptr causes an error when compiling (5. Feb. 2023)




Re: groff: error after update of gnulib, 13th January 2023

2023-01-13 Thread Bjarni Ingi Gislason
  Thanks for this.

  I renamed "error.h" in groff to "groff_error.h".



Re: groff: error after update of gnulib, 13th January 2023

2023-01-13 Thread Bjarni Ingi Gislason
  Thanks for some insights.

  I reverted the commit to get the compilation error-free.

  Some observations with the commit added

1)  /lib/error.h is not compiled from /lib/error.in.h
   It is there when the commit is abset.

2) with the commit, the config.log contains

GL_GENERATE_ERROR_H_FALSE=''
GL_GENERATE_ERROR_H_TRUE='#'

  and the Makefile contains

# We need the following in order to create  when the system
# doesn't have one that works.
#lib/error.h: lib/error.in.h $(top_builddir)/config.status $(CXXDEFS_H)
#   $(AM_V_GEN)$(MKDIR_P) 'lib'
#   $(gl_V_at)$(SED_HEADER_STDOUT) \
# -e 's|@''HAVE_ERROR''@|$(HAVE_ERROR)|g' \
# -e 's|@''HAVE_ERROR_AT_LINE''@|$(HAVE_ERROR_AT_LINE)|g' \
# -e 's|@''REPLACE_ERROR''@|$(REPLACE_ERROR)|g' \
# -e 's|@''REPLACE_ERROR_AT_LINE''@|$(REPLACE_ERROR_AT_LINE)|g' \
# -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
# $(top_srcdir)/lib/error.in.h > $@-t
#   $(AM_V_at)mv $@-t $@
lib/error.h: $(top_builddir)/config.status
rm -f $@




groff: error after update of gnulib, 13th January 2023

2023-01-12 Thread Bjarni Ingi Gislason
Software: groff

  I got these warnings in directory "groff/build" after an update of
gnulib (13th January), commit 2886cca8398f4c5a4d68368a19c0e6d0ff97c739 

  CC   lib/libgnu_a-openat-die.o
In file included from ../lib/openat-die.c:25:
../src/include/error.h:22:44: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   22 |  const errarg  = empty_errarg,
  |^~
../src/include/error.h:22:51: error: expected ';', ',' or ')' before '&' token
   22 |  const errarg  = empty_errarg,
  |   ^
../src/include/error.h:27:37: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   27 |   const errarg & = empty_errarg,
  | ^~
../src/include/error.h:27:44: error: expected ';', ',' or ')' before '&' token
   27 |   const errarg & = empty_errarg,
  |^
../src/include/error.h:32:39: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   32 | const errarg & = empty_errarg,
  |   ^~
../src/include/error.h:32:46: error: expected ';', ',' or ')' before '&' token
   32 | const errarg & = empty_errarg,
  |  ^
../src/include/error.h:37:37: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   37 |   const errarg & = empty_errarg,
  | ^~
../src/include/error.h:37:44: error: expected ';', ',' or ')' before '&' token
   37 |   const errarg & = empty_errarg,
  |^
../src/include/error.h:42:18: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   42 |const errarg & = empty_errarg,
  |  ^~
../src/include/error.h:42:25: error: expected ';', ',' or ')' before '&' token
   42 |const errarg & = empty_errarg,
  | ^
../src/include/error.h:47:18: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   47 |const errarg & = empty_errarg,
  |  ^~
../src/include/error.h:47:25: error: expected ';', ',' or ')' before '&' token
   47 |const errarg & = empty_errarg,
  | ^
../src/include/error.h:52:20: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   52 |  const errarg & = empty_errarg,
  |^~
../src/include/error.h:52:27: error: expected ';', ',' or ')' before '&' token
   52 |  const errarg & = empty_errarg,
  |   ^
../src/include/error.h:57:18: warning: type defaults to 'int' in declaration of 
'errarg' [-Wimplicit-int]
   57 |const errarg & = empty_errarg,
  |  ^~
../src/include/error.h:57:25: error: expected ';', ',' or ')' before '&' token
   57 |const errarg & = empty_errarg,
  | ^
../src/include/error.h:62:8: error: expected identifier or '(' before string 
constant
   62 | extern "C" const char *program_name;
  |^~~
../lib/openat-die.c: In function 'openat_save_fail':
../lib/openat-die.c:37:3: warning: implicit declaration of function 'error'; 
did you mean 'strerror'? [-Wimplicit-function-declaration]
   37 |   error (exit_failure, errnum,
  |   ^
  |   strerror
--- ../lib/openat-die.c
+++ ../lib/openat-die.c
@@ -34,7 +34,7 @@
 openat_save_fail (int errnum)
 {
 #ifndef GNULIB_LIBPOSIX
-  error (exit_failure, errnum,
+  strerror (exit_failure, errnum,
  _("unable to record current working directory"));
 #endif
   /* _Noreturn cannot be applied to error, since it returns
make[1]: *** [Makefile:9024: lib/libgnu_a-openat-die.o] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:6823: all] Error 2

##

  "error.h" is a local file with:

// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
 Written by James Clark (j...@jclark.com)
[...]
class errarg {
  enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type;
  union {
const char *s;
int n;
unsigned int u;
char c;
double d;
  };
 public:
  errarg();
  errarg(const char *);
  errarg(char);
  errarg(unsigned char);
  errarg(int);
  errarg(unsigned int);
  errarg(double);
  int empty() const;
  void print() const;
};

extern errarg empty_errarg;

extern void errprint(const char *,
 const errarg  = empty_errarg,
 const errarg  = 

Re: "git-version-gen" prints "Print a version string." three times

2022-10-09 Thread Bjarni Ingi Gislason
  This is invalid as I did add "set -x" to the script.



"git-version-gen" prints "Print a version string." three times

2022-10-09 Thread Bjarni Ingi Gislason
"sh -x build-aux/get-version-gen" outputs:


+ scriptversion=2022-07-09.08
+ me=build-aux/git-version-gen
+ expr 2022-07-09.08 : \([^-]*\)
+ year=2022
+ version=git-version-gen 2022-07-09.08

Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
+ usage=Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
[TAG-NORMALIZATION-SED-SCRIPT]
Print a version string.

Options:

   --prefix PREFIXprefix of git tags (default 'v')
   --fallback VERSION
  fallback version to use if "git --version" fails

   --help display this help and exit
   --version  output version information and exit

Send patches and bug reports to .
+ prefix=v
+ fallback=
+ test 0 -gt 0
+ test x = x
+ echo Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
[TAG-NORMALIZATION-SED-SCRIPT]
Print a version string.

Options:

   --prefix PREFIXprefix of git tags (default 'v')
   --fallback VERSION
  fallback version to use if "git --version" fails

   --help display this help and exit
   --version  output version information and exit

Send patches and bug reports to .
Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
[TAG-NORMALIZATION-SED-SCRIPT]
Print a version string.

Options:

   --prefix PREFIXprefix of git tags (default 'v')
   --fallback VERSION
  fallback version to use if "git --version" fails

   --help display this help and exit
   --version  output version information and exit

Send patches and bug reports to .
+ exit 1



Re: lib/malloca.c: warning about [-Wsign-compare]

2022-09-22 Thread Bjarni Ingi Gislason
On Wed, Sep 21, 2022 at 05:15:50PM -0700, Paul Eggert wrote:
> On 9/21/22 14:42, Bjarni Ingi Gislason wrote:
> 
> > you do not say for what you want (need) all this data.
> 
> We need a reproducer to figure out what is causing the problem. Perhaps the
> problem involves something going wrong and generating the wrong config.h or
> Makefile. If so, what is it?
> 
> 
> >If your are seeking a reproducer this works for me:
> > 
> >Compilation in your gnulib directory:
> > 
> > clang -I . -Wsign-compare -c lib/malloca.c
> > 
> > with ./config.h coming from the attachment (compressed file).
> 
> Sorry, that's not a reproducer. First, if the problem is that the config.h
> is wrong, this won't tell us why config.h went wrong. Second, if the problem
> is in the Makefile this won't show it to us. Third, even if I simply put
> that config.h in my gnulib directory and run that command, it won't compile
> for me (Fedora 36 x86-64, which has clang 14.0.5 (Fedora 14.0.5-1.fc36)):
> 
> $ clang -I . -Wsign-compare -c lib/malloca.c
> lib/malloca.c:24:10: fatal error: 'stdckdint.h' file not found
> #include 
>  ^

  I had copied this file from that generated in groff to /usr/include
and changed " around its name to < and >.

> 
> We need a complete reproducer from scratch, not just dribs and drabs. If
> it's too much work for you to generate one that's OK, we can wait until
> someone else runs into the issue, whatever it is.
> 
  I think so given that this is a compilation warning.

> Here's the shell command that I used to try to reproduce the problem on
> Fedora 36 x86-64, from a fresh Gnulib checkout. This shell command succeeded
> for me. Can you alter this recipe so that I can easily reproduce the problem
> with an altered recipe, so that the test fails?
> 
>   CC=clang ./gnulib-tool --test malloca
> 

  Yes (hopefully).


  When I use

CC='clang -Wsign-compare' ./gnulib-tool --test malloca 2>
test.malloca.err > testmalloca.std

I get no failure but a lot on standard error.

cat test.malloca.err | sed  -e 's/\:[0-9]*\:[0-9]*\:/\:/' | grep -F
'warning:' | sort -u 

gives

../../gllib/malloca.c: warning: comparison of integers of different signs: 
'unsigned long' and 'idx_t' (aka 'long') [-Wsign-compare]
../../gllib/malloca.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-assert.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-intprops.c: warning: comparison of integers of different 
signs: 'int' and 'unsigned int' [-Wsign-compare]
../../gltests/test-intprops.c: warning: comparison of integers of different 
signs: 'int' and 'unsigned long' [-Wsign-compare]
../../gltests/test-intprops.c: warning: comparison of integers of different 
signs: 'unsigned long long' and 'int' [-Wsign-compare]
../../gltests/test-intprops.c: warning: '_Static_assert' with no message is a 
C2x extension [-Wc2x-extensions]
../../gltests/test-limits-h.c: warning: '_Static_assert' with no message is a 
C2x extension [-Wc2x-extensions]
../../gltests/test-stdalign.c: warning: '_Static_assert' with no message is a 
C2x extension [-Wc2x-extensions]
../../gltests/test-stddef.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-stdlib.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-string.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-unistd.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]
../../gltests/test-wchar.c: warning: '_Static_assert' with no message is a C2x 
extension [-Wc2x-extensions]


  To get a failure I had to "cheat", added a pragma to "tests/test-malloca.c"

#pragma GCC diagnostic ignored "-Wno-error"


and run with "CC='clang -Werror=sign-compare' ..."




Re: lib/malloca.c: warning about [-Wsign-compare]

2022-09-21 Thread Bjarni Ingi Gislason
On Mon, Sep 19, 2022 at 02:39:35AM +0200, Bruno Haible wrote:
> Bjarni,
> 
> Please use the bug report template from
> .
> 
  Hi,

you do not say for what you want (need) all this data.

  If your are seeking a reproducer this works for me:

  Compilation in your gnulib directory:

clang -I . -Wsign-compare -c lib/malloca.c

with ./config.h coming from the attachment (compressed file).



config.h.gz
Description: application/gzip


lib/malloca.c: warning about [-Wsign-compare]

2022-09-18 Thread Bjarni Ingi Gislason
  Compilation with

Debian clang version 14.0.6-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Software: groff (git HEAD)

  CC   lib/libgnu_a-malloca.o
../lib/malloca.c:54:38: warning: comparison of integers of different
signs: 'unsigned long' and 'idx_t' (aka 'long') [-Wsign-compare]
  if (!ckd_add (, n, plus) && !xalloc_oversized (nplus, 1))
 ^~~
../lib/xalloc-oversized.h:62:33: note: expanded from macro 'xalloc_oversized'
# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
^
../lib/xalloc-oversized.h:33:8: note: expanded from macro '__xalloc_oversized'
   < (n)))
   ^  ~
1 warning generated.
 



Re: lib/malloca.c: error when compiling "groff"

2022-09-18 Thread Bjarni Ingi Gislason
  The source of the compilation error was the file
"src/include/assert.h" in "groff".

  Removing it fixes the compilation.



Re: lib/malloca.c: error when compiling "groff"

2022-09-15 Thread Bjarni Ingi Gislason
  Here are some missing files to reproduce my case

1) bootstrap.conf in an attachment

2) bootstrap.out  -- " --

Other information

gnulib: commit e441260eab816e9b6d202fe7ac288ec2a7b72f34
  Date: Thu Sep 15 00:50:41 2022 +0200

autoconf (GNU Autoconf) 2.71

automake (GNU automake) 1.16.5

GNU Make 4.3.90: commit f6ea899d83bf00fe9201fde0ca9cf7af8e443677
  Date: Mon Sep 12 18:18:49 2022 -0400

git version 2.35.1

libtool (GNU libtool) 2.4.7-4 (Debian testing)
# Bootstrap configuration.

# Copyright (C) 2006-2022 Free Software Foundation, Inc.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .


# gnulib m4 macro 
m4_base=gnulib_m4

# gnulib C source files
source_base=lib

# additional standard files, particularly added by 
# automake --add-missing
build_aux=build-aux

gnulib_name=libgnu

# This file is not distributed and used to check if the bootstrap
# script is not launched on a tarball
checkout_only_file=README.git

# gnulib modules used by this package.
# havelib provides config.rpath
# can be get through gettext though
# gen-header added 25th December 2021
# non-recursive-gnulib-prefix-hack removed 22th January 2022

gnulib_modules="
git-version-gen
havelib
manywarnings
wcwidth
fprintf-posix
gen-header
snprintf
vsnprintf-posix
warnings
  mkstemp
  fmod
  getcwd
  putenv
  strcase
  strerror
  strtol
  setlocale
 "
# non-recursive-gnulib-prefix-hack was removed as deprecated
# (around 20th December 2021)

# Name of the Makefile.am
gnulib_tool_option_extras="
--makefile-name=gnulib.mk
--automake-subdir"

# Additional xgettext options to use.  Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
 --from-code=UTF-8\\\
 --flag=asprintf:2:c-format --flag=vasprintf:2:c-format\\\
 --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\
 --flag=wrapf:1:c-format\\\
'

# If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
# appears in configure.ac, exclude some unnecessary files.
# Without grep's -E option (not portable enough, pre-configure),
# the following test is ugly.  Also, this depends on the existence
# of configure.ac, not the obsolescent-named configure.in.  But if
# you're using this infrastructure, you should care about such things.

gettext_external=0
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
  gettext_external=1
grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
  gettext_external=1

if test $gettext_external = 1; then
  # Gettext supplies these files, but we don't need them since
  # we don't have an intl subdirectory.
  excluded_files='
  m4/glibc2.m4
  m4/intdiv0.m4
  m4/lcmessage.m4
  m4/lock.m4
  m4/printf-posix.m4
  m4/size_max.m4
  m4/uintmax_t.m4
  m4/ulonglong.m4
  m4/visibility.m4
  m4/xsize.m4
  '
fi

# Build prerequisites
buildreq="\
autoconf   2.68
automake   1.12.2
git1.5.5
libtool2.2.2
tar-
pkg-config -
"

bootstrap_post_import_hook ()
{
  # Automake requires that ChangeLog exist.
  touch ChangeLog || return 1
}
Is on branch bjarni
boostrap.loc: bootstrapping with --gnulib-src=/home/bg/git/gnulib
./bootstrap: Bootstrapping from checked-out groff sources...
./autogen.sh: /home/bg/git/gnulib/gnulib-tool--no-changelog   
--aux-dir=build-aux   --doc-base=doc   --lib=libgnu   --m4-base=gnulib_m4/   
--source-base=lib/   --tests-base=tests   --local-dir=gl   
--makefile-name=gnulib.mk
--automake-subdir   --import ...
Module list with included dependencies (indented):
absolute-header
alloca-opt
assert-h
assure
at-internal
attribute
basename-lgpl
c99
chdir
chdir-long
clock-time
cloexec
close
closedir
d-ino
dirent
dirfd
dirname-lgpl
double-slash-root
dup
dup2
environ
errno
error
exitfail
extensions
extern-inline
fabs
fchdir
fcntl
fcntl-h
fd-hook
fd-safer-flag
fdopendir
filename
filenamecat-lgpl
flexmember
float
  fmod
fpieee
  fprintf-posix
fpucw
free-posix
frexp
frexp-nolibm
frexpl-nolibm
fseterr
fstat
fstatat
  gen-header
  getcwd
getcwd-lgpl
getdtablesize
getprogname
getrandom
gettext-h
  git-version-gen
  havelib
idx
include_next
intprops
inttypes-incomplete
isfinite
isinf
isnand

Re: lib/malloca.c: error when compiling "groff"

2022-09-14 Thread Bjarni Ingi Gislason
  I get the same error with "gcc-11 (Debian 11.3.0-5) 11.3.0" and gcc-10

  In "config.log" I see:

configure:21128: checking for static_assert
configure:21162: /usr/bin/gcc-10 -c -Walloc-zero -Walloca -Wall -Wextra 
-Wformat=2 -Wattribute-warning -Wdate-time -Wformat-security 
-Wfree-nonheap-object -Wimplicit-fallthrough=3 -Wmaybe-uninitialized 
-Wstringop-overflow=4 -Wredundant-decls -Wshadow=global -Wuninitialized 
-Wunused -Wunused-parameter -Wvla -fdiagnostics-generate-patch -fsanitize=bool 
-fsanitize=enum -fsanitize=signed-integer-overflow 
-fsanitize=integer-divide-by-zero,shift,null -fsanitize-undefined-trap-on-error 
-fno-sanitize=pointer-overflow -fsanitize=return 
-fsanitize=alignment,object-size,vptr,pointer-overflow -O0 
-fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv 
-funsigned-char -fvar-tracking-assignments -ggdb3 -pedantic -fsanitize=null 
-fsanitize=nonnull-attribute  -Wmissing-prototypes -Wold-style-definition 
-Wstrict-prototypes  -Wold-style-declaration  -std=c2x  -D_FORTIFY_SOURCE=2 
-DGCC_LINT -DGNULIB_NO_VLA  conftest.c >&5
conftest.c:125:28: error: expected declaration specifiers or '...' before 
numeric constant
  125 | static_assert (2 + 2 == 4, "arithmetic does not work");
  |^
conftest.c:125:40: error: expected declaration specifiers or '...' before 
string constant
  125 | static_assert (2 + 2 == 4, "arithmetic does not work");
  |^~
conftest.c:126:28: error: expected declaration specifiers or '...' before 
numeric constant
  126 | static_assert (2 + 2 == 4);
  |^
conftest.c: In function 'main':
conftest.c:132:13: warning: implicit declaration of function 'static_assert' 
[-Wimplicit-function-declaration]
  132 | static_assert (sizeof (char) == 1, "sizeof does not work");
  | ^
configure:21162: $? = 1

  In /usr/include/assert.h is

#if defined __USE_ISOC11 && !defined __cplusplus
# undef static_assert
# define static_assert _Static_assert
#endif

  Adding "-D__USE_ISOC11" to CPPFLAGS shows the same lines in "config.log".

  "assert.h" is from Debian 

Package: libc6-dev
[...]
Source: glibc
Version: 2.34-7



Re: lib/malloca.c: error when compiling "groff"

2022-09-14 Thread Bjarni Ingi Gislason
On Wed, Sep 14, 2022 at 04:45:20PM -0500, Paul Eggert wrote:
> Can you reproduce the problem with my recipe?
> 
> One possibility is that you have an old malloca.c left over from an old
> build, and it won't compile with the new Gnulib. So it may help to bootstrap
> from scratch.
> 
(all times in UTC)

  I had bootstrapped at 19.55 UTC so I missed the latest commit.

  I bootstrapped at 22.39 UTC with these changes:

Updating file gnulib_m4/assert_h.m4 (backup in gnulib_m4/assert_h.m4~)
Updating file lib/verify.h (backup in lib/verify.h~)

  I made distclean, configured, and compiled with the same error.

  I have the same last commit as you (plus some (not new) local changes
in the groff sources).

  My malloca.c in groff/lib is

-rw--- 1 bg bg 3701 sep 14 19:54 malloca.c

N.B. I use a lot of options for "gcc".



Re: lib/malloca.c: error when compiling "groff"

2022-09-14 Thread Bjarni Ingi Gislason
/usr/bin/gcc-12 -DHAVE_CONFIG_H -I. -I.. -I./src/include 
-I../src/include -I../lib -I./src/include -I./lib -D_FORTIFY_SOURCE=2
-DGCC_LINT -DGNULIB_NO_VLA   -Wno-cast-qual -Wno-conversion
-Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function
-Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough
-Wno-pedantic -Wno-sign-conversion -Wno-type-limits
-Wno-unsuffixed-float-constants -Walloc-zero -Walloca -Wall -Wextra
-Wformat=2 -Wattribute-warning -Wdate-time -Wformat-security
-Wfree-nonheap-object -Wimplicit-fallthrough=3 -Wmaybe-uninitialized
-Wstringop-overflow=4 -Wredundant-decls -Wshadow=global -Wuninitialized
-Wunused -Wunused-parameter -Wvla -fdiagnostics-generate-patch
-fsanitize=bool -fsanitize=enum -fsanitize=signed-integer-overflow
-fsanitize=integer-divide-by-zero,shift,null
-fsanitize-undefined-trap-on-error -fno-sanitize=pointer-overflow
-fsanitize=return -fsanitize=alignment,object-size,vptr,pointer-overflow
-O0 -fstack-protector-strong -fno-common -fstack-clash-protection
-ftrapv -funsigned-char -fvar-tracking-assignments -ggdb3 -pedantic
-fsanitize=null -fsanitize=nonnull-attribute  -Wmissing-prototypes
-Wold-style-definition -Wstrict-prototypes  -Wold-style-declaration 
-std=c2x  -MT lib/libgnu_a-malloca.o -MD -MP -MF
lib/.deps/libgnu_a-malloca.Tpo -c -o lib/libgnu_a-malloca.o `test -f
'lib/malloca.c' || echo '../'`lib/malloca.c
../lib/malloca.c:42:16: error: expected declaration specifiers or '...'
before numeric constant
  



lib/malloca.c: error when compiling "groff"

2022-09-14 Thread Bjarni Ingi Gislason
CC = gcc (Debian 12.2.0-1) 12.2.0

  CC   lib/libgnu_a-malloca.o
../lib/malloca.c:42:16: error: expected declaration specifiers or '...' before 
numeric constant
   42 | static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
  |^
make[1]: *** [Makefile:8629: lib/libgnu_a-malloca.o] Error 1


  Line was recently changed in commit:

28465e160f242e39e6008e6de674e7c2360cf7df
Author: Paul Eggert 
Date:   Tue Sep 13 17:29:36 2022 -0500


 /* Type for holding very small pointer differences.  */
 typedef unsigned char small_t;
 /* Verify that it is wide enough.  */
-verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);



Re: vasnprintf.c: "out_of_memory", -Wanalyzer-free-of-non-heap, -Wanalyzer-malloc-leak

2022-05-01 Thread Bjarni Ingi Gislason
On Sat, Apr 30, 2022 at 01:27:28PM -0700, Paul Eggert wrote:
> On 4/30/22 07:13, Bjarni Ingi Gislason wrote:
> >With latest gnulib version:
> 
> I'm not seeing this problem with the current
> (84863a1c4dc8cca8fb0f6f670f67779cdd2d543b) gnulib version on Fedora 35
> x86-64, which has GCC 11.3.1 20220421 (Red Hat 11.3.1-2).
> 
> Here's how I tried to reproduce the issue:
> 
> ./gnulib-tool -h --create-testdir --dir foo vasnprintf
> cd foo
> ./configure
> make CFLAGS='-fanalyzer -Wanalyzer-mismatching-deallocation -O2' check
> 
> Does the above work for you? If so, how does it differ from what groff does?
> 
> The idea is to make the problem reproducible without dealing with groff or
> with whatever changes you made to groff. If that's not possible, I guess
> we'll need a copy of your groff source since it sounds like you've modified
> groff.

  Thanks for the method to test "vasnprintf.c" separately.

  I checked what of the about 30 options, I use for compiling "groff",
could cause the only warning (leak) about "vasnprintf.c" and it was the
"-flto".

  The compilation of "groff" then got finished with a lot of warnings
(149) about its code.

-- 
Bjarni I. Gislason



vasnprintf.c: "out_of_memory", -Wanalyzer-free-of-non-heap, -Wanalyzer-malloc-leak

2022-04-30 Thread Bjarni Ingi Gislason
  With latest gnulib version:

commit d6a07b4dc21b3118727743142c678858df442853 (origin/master, origin/HEAD)
Author: Simon Marchi 
Date:   Fri Apr 29 01:47:55 2022 +0200


  While compiling "groff" (for exampe while creating "grodvi") with
gcc-11.3 options "-fanalyzer -Wanalyzer-mismatching-deallocation"
warnings were issued:

In function 'vasnprintf':
../lib/vasnprintf.c:5849:7: warning: 'free' of 'result_334' which points
to memory not on the heap [CWE-590] [-Wanalyzer-free-of-non-heap]
 5849 |   free (result);
 ...

  and

../lib/vasnprintf.c:5855:5: warning: leak of 'result_20' [CWE-401]
[-Wanalyzer-malloc-leak]
 5855 | return NULL;
 ...

  Major part of the output was:

  AR   lib/libgnu.a
  CXXLDgrodvi
In function 'vasnprintf':
../lib/vasnprintf.c:5849:7: warning: 'free' of 'result_334' which points to 
memory not on the heap [CWE-590] [-Wanalyzer-free-of-non-heap]
 5849 |   free (result);
  |   ^
  'rpl_fprintf': events 1-2
|
|../lib/fprintf.c:36:1:
|   36 | fprintf (FILE *fp, const char *format, ...)
|  | ^
|  | |
|  | (1) entry to 'rpl_fprintf'
|..
|   45 |   output = vasnprintf (buf, , format, args);
|  |~
|  ||
|  |(2) calling 'vasnprintf' from 'rpl_fprintf'
|
+--> 'vasnprintf': events 3-4
   |
   |../lib/vasnprintf.c:1858:1:
   | 1858 | VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
   |  | ^
   |  | |
   |  | (3) entry to 'vasnprintf'
   |..
   | 1864 |   if (PRINTF_PARSE (format, , ) < 0)
   |  |   ~
   |  |   |
   |  |   (4) calling 'printf_parse' from 'vasnprintf'
   |
   +--> 'printf_parse': events 5-6
  |
  |../lib/printf-parse.c:74:1:
  |   74 | PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, 
arguments *a)
  |  | ^
  |  | |
  |  | (5) entry to 'printf_parse'
  |..
  |  128 |   if (c == '%')
  |  |  ~
  |  |  |
  |  |  (6) following 'false' branch...
  |
'printf_parse': event 7
  |
  |lto1:
  | (7): ...to here
  |
   <--+
   |
 'vasnprintf': events 8-11
   |
   |../lib/vasnprintf.c:1864:7:
   | 1864 |   if (PRINTF_PARSE (format, , ) < 0)
   |  |  ~^
   |  |  ||
   |  |  |(8) returning to 'vasnprintf' from 'printf_parse'
   |  |  (9) following 'false' branch...
   |..
   | 1875 |   if (PRINTF_FETCHARGS (args, ) < 0)
   |  |   ~   ~
   |  |   |   |
   |  |   |   (11) calling 'printf_fetchargs' from 'vasnprintf'
   |  |   (10) ...to here
   |
   +--> 'printf_fetchargs': events 12-13
  |
  |../lib/printf-args.c:36:1:
  |   36 | PRINTF_FETCHARGS (va_list args, arguments *a)
  |  | ^
  |  | |
  |  | (12) entry to 'printf_fetchargs'
  |..
  |   41 |   for (i = 0, ap = >arg[0]; i < a->count; i++, 
ap++)
  |  |  ~
  |  |  |
  |  |  (13) following 
'false' branch...
  |
'printf_fetchargs': event 14
  |
  |lto1:
  | (14): ...to here
  |
   <--+
   |
 'vasnprintf': events 15-17
   |
   |../lib/vasnprintf.c:1875:7:
   | 1875 |   if (PRINTF_FETCHARGS (args, ) < 0)
   |  |  ~^
   |  |  ||
   |  |  |(15) returning to 'vasnprintf' from 'printf_fetchargs'
   |  |  (16) following 'false' branch...
   |..
   | 1883 | size_t buf_neededlength;
   |  | ~  
   |  | |
   |  | (17) ...to here
   |
 'vasnprintf': events 18-19
   |
   |../lib/xsize.h:66:30:
   |   66 |   return (sum >= size1 ? sum : SIZE_MAX);
   |  |  ^
   |  |  |
   |  |  (18) following 'true' branch...
   |..
   |   80 |   return xsum (xsum (xsum (size1, size2), size3), size4);
   |  |  ~
   |  |  |
   |  |  (19) 

"bootstrap" changed without adjusting version string

2022-01-25 Thread Bjarni Ingi Gislason
File: git/gnulib/build-aux/bootstrap

scriptversion=2021-04-11.09;

  According to "git blame bootstrap", material has been added at dates
"2021-12-12" and "2022-01-05" without updating the announced string
"scriptversion" in the output of "bootstrap --version".

  This also affects the string "copyright_year".

-- 
Bjarni I. Gislason



gnulib-tool: warnings of type "module --automake-subdir doesn't exist"

2022-01-22 Thread Bjarni Ingi Gislason
  Command: gnulib-tool --add-import

  Output with a warning:

gnulib-tool: warning: module --automake-subdir doesn't exist
gnulib-tool: warning: module --aux-dir=build-aux doesn't exist
gnulib-tool: warning: module --doc-base=doc doesn't exist
gnulib-tool: warning: module --lib=libgnu doesn't exist
gnulib-tool: warning: module --local-dir=gl doesn't exist
gnulib-tool: warning: module --m4-base=gnulib_m4/ doesn't exist
gnulib-tool: warning: module --makefile-name=gnulib.mk doesn't exist
gnulib-tool: warning: module --no-changelog doesn't exist
gnulib-tool: warning: module --source-base=lib/ doesn't exist
gnulib-tool: warning: module --tests-base=tests doesn't exist

-- 
Bjarni I. Gislason



Re: undefined references to "rpl_fclose" and "rpl_fflush"

2022-01-19 Thread Bjarni Ingi Gislason
On Tue, Jan 18, 2022 at 12:20:46AM +0100, Bruno Haible wrote:
[...]

  Thanks for the tips.

  The "fclose.c" and "fflush.c" files do not get compiled as they are
included in a different make variable

am__lib_libgroff_a_SOURCES_DIST

  which is part of a target "distfile".

  For the default target the make variable is

am__libgroff_a_SOURCES_DIST


  To fix this I added files from "git/gnulib/lib" to
"groff/src/libs/libgroff" and their names to "libgroff.am", and the
names of their gnulib modules to "bootstrap.conf".

  This has a defect as the files in "libgroff" do not automatically get
updated, I will use links instead.

-- 
Bjarni I. Gislason



undefined references to "rpl_fclose" and "rpl_fflush"

2022-01-17 Thread Bjarni Ingi Gislason
Software: groff

  Adding some gnulib modules to "bootstrap.conf" after checking with
module "posixcheck":

close
dup
execvp
fclose
fdopen
fflush
fopen
freopen
malloc-posix
nl_langinfo
pclose
perror
pipe-posix
popen
realloc-posix
strerror
strsignal
strtol
tmpfile

results in linker errors:

make[1]: Entering directory '/home/bg/git/groff/build'
  CXX  src/libs/libdriver/input.o
  CXX  src/libs/libdriver/printer.o
  AR   libdriver.a
  CXX  src/libs/libgroff/libgroff_a-assert.o
  CXX  src/libs/libgroff/libgroff_a-error.o
  CXX  src/libs/libgroff/libgroff_a-font.o
  AR   libgroff.a
  CXXLDgrodvi
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`text_file::~text_file()':
/home/bg/git/groff/build/../src/libs/libgroff/font.cpp:102: undefined
reference to `rpl_fclose'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`assertion_failed(int, char const*, char const*, char const*)':
/home/bg/git/groff/build/../src/libs/libgroff/assert.cpp:37: undefined
reference to `rpl_fflush'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`font::scan_papersize(char const*, char const**, double*, double*)':
/home/bg/git/groff/build/../src/libs/libgroff/font.cpp:774: undefined
reference to `rpl_fclose'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`do_error_with_file_and_line(char const*, char const*, int, error_type,
char const*, errarg const&, errarg const&, errarg const&)':
/home/bg/git/groff/build/../src/libs/libgroff/error.cpp:83: undefined
reference to `rpl_fflush'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`printer::~printer()':
/home/bg/git/groff/build/../src/libs/libdriver/printer.cpp:95: undefined
reference to `rpl_fflush'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function `do_file(char
const*)':
/home/bg/git/groff/build/../src/libs/libdriver/input.cpp:1827: undefined
reference to `rpl_fclose'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function `do_file(char
const*)':
/home/bg/git/groff/build/../src/libs/libgroff/font.cpp:102: undefined
reference to `rpl_fclose'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`font::load(bool)':
/home/bg/git/groff/build/../src/libs/libgroff/font.cpp:102: undefined
reference to `rpl_fclose'
/usr/bin/ld: /tmp/ccwhBA9z.ltrans0.ltrans.o: in function
`do_error_with_file_and_line(char const*, char const*, int, error_type,
char const*, errarg const&, errarg const&, errarg const&)':
/home/bg/git/groff/build/../src/libs/libgroff/error.cpp:83: undefined
reference to `rpl_fflush'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:7506: grodvi] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:6763: all] Error 2

  This is both without and with "#include " as the first
include statement in "assert.cpp", "error.cpp", "font.cpp", "input.cpp",
and "printer.cpp".

  The file "build/libgroff.a" contains these "rpl_" strings:

rpl_fprintf
rpl_fflush
rpl_fprintf
rpl_fflush
rpl_fprintf
rpl_fprintf
rpl_fprintf
rpl_fflush
rpl_fflush
rpl_fclose
rpl_fclose
rpl_fprintf
Urpl_fprintf
.gnu.lto_rpl_fprintf.46.a0e291f44b54f74a
rpl_fprintf
rpl_fprintf
rpl_fclose
rpl_fclose
rpl_fprintf
rpl_fprintf

  The file "build/libdriver.a" contains these "rpl_" strings

rpl_fclose
rpl_fclose
rpl_fflush
rpl_fflush


  Compilation is normal if I remove the modules "fclose" and "fflush"
from "bootstrap.conf".

-- 
Bjarni I. Gislason



gnulib-tool with "--makefile-name=gnulib.mk" creates a file with 'lib/' inserted to first line of "SED_HEADER_... ="

2021-12-27 Thread Bjarni Ingi Gislason
  Software: groff; latest in my repository with fixes for latest gnulib.

  gnulib: latest in repository

  Produced file "groff/lib/gnulib.mk" contains:

--- start piece of code ---

## begin gnulib module gen-header

# In 'sed', prepend a "DO NOT EDIT" comment to the pattern space.
SED_HEADER_NOEDIT = lib/s,^,/* lib/DO lib/NOT lib/EDIT! lib/GENERATED 
lib/AUTOMATICALLY! lib/*/,

# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
SED_HEADER_STDOUT = lib/sed \
  -e x \
  -e '1$(SED_HEADER_NOEDIT)p' \
  -e x

# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
# "DO_NOT_EDIT".  Although this could be done more simply via:
#   SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
# the -n and 'w's avoid a fork+exec, at least when GNU Make is used.
SED_HEADER_TO_AT_t = lib/sed -n \
  -e x \
  -e '1$(SED_HEADER_NOEDIT)w $@-t' \
  -e x \
  -e 'w $@-t'

# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
# is its recipe's first line if and only if  lines are absent.
gl_V_at = $(AM_V_at)

## end   gnulib module gen-header

--- end of piece of code ---

  Some definitions in the bootstrap.conf of groff:

gnulib_modules="
git-version-gen
havelib
wcwidth
fprintf-posix
snprintf
vsnprintf
gen-header
"
gnulib_tool_option_extras="--makefile-name=gnulib.mk --automake-subdir"

  Used programs:

automake (GNU automake) 1.16.5

autoconf (GNU Autoconf) 2.71

-- 
Bjarni I. Gislason



gnulib-tool: possibly a misleading reminder about "ACLOCAL_AMFLAGS"

2021-12-18 Thread Bjarni Ingi Gislason
  In the output of "bootstrap" there is a reminder:

[...]
Don't forget to
[...]
  - mention "-I gnulib_m4" in ACLOCAL_AMFLAGS in Makefile.am,
[...]

End of quotation.

  "ACLOCAL_AMFLAGS" in "Makefile.am" is going to be replaced by
"AC_CONFIG_MARCO_DIRS" (in configure.ac) according to file "NEWS-2.0"
in the "automake" repository:

[...]
* WARNING: Future backward-incompatibilities!

[...]
  - The ACLOCAL_AMFLAGS special make variable will be fully deprecated in
Automake 2.0: it will raise warnings in the "obsolete" category (but
still no hard error of course, for compatibilities with the many, many
packages that still relies on that variable).  You are advised to
start relying on the new Automake support for AC_CONFIG_MACRO_DIRS
instead (which was introduced in Automake 1.13).

End of quotation from NEWS-2.0.

  To avoid a confusion, adding something like:

  - or "gnulib_m4" in its replacement
"AC_CONFIG_MACRO_DIRS([DIR1 ...])" in "configure.ac",

  to the output of "bootstrap" could be advisable to avert uncertainty.

-- 
Bjarni I. Gislason



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

2021-10-09 Thread Bjarni Ingi Gislason
On Sat, Oct 09, 2021 at 12:53:41AM -0700, Paul Eggert wrote:
> On 10/8/21 6:43 PM, Bjarni Ingi Gislason wrote:
> >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'
> 
> 
> This is a bug in Groff, not Gnulib, since that file does not include
>  first. I submitted a Groff bug report here:
> 
> https://savannah.gnu.org/bugs/index.php?61315

Thanks, I had already added #include "config.h" (not ) to
some files when the output of a compilation had a message about this
being missing.

  Thus now I only needed to add it to "Dvi.c" and "xmalloc.c" to finish
the compilation.

-- 
Bjarni I. Gislason



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

2021-10-08 Thread Bjarni Ingi Gislason
[...]
  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



Re: "rpl_fprintf" not found if compiled with options "-ggdb -Og"

2021-07-31 Thread Bjarni Ingi Gislason
On Sat, Jul 31, 2021 at 01:31:55AM -0700, Paul Eggert wrote:
> On 7/30/21 6:43 PM, Bjarni Ingi Gislason wrote:
> >Actually I am using the current repository of both "groff" and
> > "gnulib".
> 
> I can't reproduce the problem that way, either. I'm using Ubuntu 21.04. I
> clone Savannah's latest groff (7ae6d67b7c310c54bb7176c761b1f9719e64201a),
> run this:
> 
> ./bootstrap --gnulib-srcdir=$HOME/src/gnu/gnulib-savannah
> ./configure
> make CFLAGS='-ggdb -Og'
> 
> and it builds (there are quite a few warnings, which should get fixed, but
> nothing fatal to the build). $HOME/src/gnu/gnulib-savannah contains a copy
> of Savannah's latest Gnulib (commit
> 804ac808a9b17d7ee7cf49f7c713c4a4e4d6423f).
> 
> The symptoms you're reporting are that of a partial build that isn't being
> resumed correctly somehow.
> 
> By the way, I've not had much luck with -Og. I have better luck with -O0
> when debugging. But then, I mostly debug C code, not C++.

  Thanks for testing.

  I compile in the directory "groff/build".

  I have two branches, my own and master.

  The error is in my branch.

  It is caused by having simultaneously

CFLAGS='-O...'

  and 

CPPFLAGS=-D_FORTIFY_SOURCE=2

  Changing the value from 2 to 0 or 1, eliminates the error.

  My version of glibc is 2.31-13 (Debian, testing).

  As Debian uses both '-O2' and "-D_FORTIFY_SOURCE=2" for its
compilation,
a fix seems to be necessary.

###

  In the master branch I get, with the default output from "configure",
this

  CC   src/devices/xditview/gxditview-page.o
In file included from /usr/include/X11/Xos.h:89,
 from ../src/devices/xditview/page.c:7:
./lib/unistd.h:663:3: error: #error "Please include config.h first."
  663 |  #error "Please include config.h first."
  |   ^
./lib/unistd.h:665:24: error: expected ';' before 'extern'
  665 | _GL_INLINE_HEADER_BEGIN
  |^
  |;
./lib/unistd.h:2815:22: error: expected ';' before 'struct'
 2815 | _GL_INLINE_HEADER_END
  |  ^
  |  ;
make[1]: *** [Makefile:7219: src/devices/xditview/gxditview-page.o]
Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'

  In my branch I have added the missing '#include "config.h"' in
../src/devices/xditview/page.c
and other missing "config.h" lines in other source files.

-- 
Bjarni I. Gislason



Re: "rpl_fprintf" not found if compiled with options "-ggdb -Og"

2021-07-30 Thread Bjarni Ingi Gislason
On Wed, Jul 28, 2021 at 02:37:00PM -0700, Paul Eggert wrote:
> I'm not seeing this problem when building groff 1.22.4 (the latest version)
> on Ubuntu 21.04, which has GCC Ubuntu 10.3.0-1ubuntu1. I built by doing
> this:
> 
> wget https://ftp.gnu.org/pub/gnu/groff/groff-1.22.4.tar.gz
> cd groff-1.22.4/
> ./configure
> make
> 
> What happens when you try the above steps on your platform?

  The compilation of this version of "groff" and thus the used "gnulib"
version of that, resulted in no error.

  Actually I am using the current repository of both "groff" and
"gnulib".

  I compiled these versions with the option "-O" instead of "-ggdb -Og"
and got the same error.

  Compilation with

gcc-9 (Debian 9.3.0-22) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.

  showed the same error.

-- 
Bjarni I. Gislason



"rpl_fprintf" not found if compiled with options "-ggdb -Og"

2021-07-28 Thread Bjarni Ingi Gislason
Software: groff
  and
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.


Error:

  CCLD gxditview
/usr/bin/ld: src/devices/xditview/gxditview-device.o: in function 
`open_device_file':
/home/bg/git/groff/build/../src/devices/xditview/device.c:535: undefined 
reference to `rpl_fprintf'
/usr/bin/ld: src/devices/xditview/gxditview-device.o: in function `error':
/home/bg/git/groff/build/../src/devices/xditview/device.c:546: undefined 
reference to `rpl_fprintf'
/usr/bin/ld: /home/bg/git/groff/build/../src/devices/xditview/device.c:548: 
undefined reference to `rpl_fprintf'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:6472: gxditview] Error 1


Code in groff:

535   fprintf(stderr, "can't find device file '%s'\n", file_name);

546 fprintf(stderr, "%s:", current_filename);

Defined GNULIB* containing "FPRINTF" in Makefile:

GL_GNULIB_FPRINTF = 1
GL_GNULIB_FPRINTF_POSIX = 1
GL_GNULIB_VFPRINTF = 1
GL_GNULIB_VFPRINTF_POSIX = 0
REPLACE_FPRINTF = 1
REPLACE_VFPRINTF = 0

Code in gnulib/lib/stdio.in.h (groff/gnulib/stdio.in.h):

#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
 || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
#   define fprintf rpl_fprintf
#  endif
#  define GNULIB_overrides_fprintf 1
#  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
_GL_FUNCDECL_RPL (fprintf, int,
  (FILE *restrict fp, const char *restrict format, ...)
  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
  _GL_ARG_NONNULL ((1, 2)));
#  else
_GL_FUNCDECL_RPL (fprintf, int,
  (FILE *restrict fp, const char *restrict format, ...)
  _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
  _GL_ARG_NONNULL ((1, 2)));
#  endif
_GL_CXXALIAS_RPL (fprintf, int,
  (FILE *restrict fp, const char *restrict format, ...));
# else
_GL_CXXALIAS_SYS (fprintf, int,
  (FILE *restrict fp, const char *restrict format, ...));
# endif


-- 
Bjarni I. Gislason



doc/gnulib-intro.texi: A "to" is missing in a sentence.

2020-05-26 Thread Bjarni Ingi Gislason
  The text is:

All patches should be posted the list, ...


  It is also in the files "doc/gnulib.html" and "doc/gnulib.info".

-- 
Bjarni I. Gislason



users.txt: "groff" uses gnulib//

2020-02-22 Thread Bjarni Ingi Gislason




[PATCH] lib/vasnprintf.c: Add information to make integer comparison logical

2018-09-22 Thread Bjarni Ingi Gislason
  A question (comment) from the compiler (gcc 8.2):

../lib/vasnprintf.c:5107:35: warning: comparison of integer expressions of 
different signedness: 'int' and 'size_t' {aka 'long unsigned int'} 
[-Wsign-compare]
 if (count < maxlen
   ^
  The value of "count" is tested to be non-negative, so a cast to
"size_t" is valid.

Signed-off-by: Bjarni Ingi Gislason 
---
 lib/vasnprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 56ffbe308..bf9d6dea9 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -5125,7 +5125,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
   {
 /* Verify that snprintf() has NUL-terminated its
result.  */
-if (count < maxlen
+if ((size_t) count < maxlen
 && ((TCHAR_T *) (result + length)) [count] != '\0')
   abort ();
 /* Portability hack.  */
-- 
2.19.0

-- 
Bjarni I. Gislason



[PATCH] Remove repeated words

2017-05-22 Thread Bjarni Ingi Gislason
Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 ChangeLog | 16 
 build-aux/texinfo.tex |  2 +-
 lib/fd-hook.c |  2 +-
 lib/fd-hook.h |  2 +-
 lib/savewd.c  |  2 +-
 lib/uninorm/decomposition-table.h |  2 +-
 modules/atoll |  2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 541952e49..66a8328a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7484,7 +7484,7 @@
HAVE_GETXATTR.
* m4/acl.m4 (gl_FILE_HAS_ACL): Test fot the entire combination of
linux/xattr.h, sys/xattr.h, getxattr, XATTR_NAME_POSIX_ACL_ACCESS,
-   and XATTR_NAME_POSIX_ACL_DEFAULT, since that's what what
+   and XATTR_NAME_POSIX_ACL_DEFAULT, since that's what
file-has-acl.c actually needs.
 
 2015-04-26  Pádraig Brady  <p...@draigbrady.com>
@@ -10814,7 +10814,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
* m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME):
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS):
* modules/time (time.h):
-   Don't worry about about the possibility of localtime and gmtime
+   Don't worry about the possibility of localtime and gmtime
being absent; they're present in all C libraries we know about.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS):
Don't assume sys_time is present and has been initialized.
@@ -10882,7 +10882,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK):
Add support for a new option, --with-openssl=auto, which causes
the library to be used if available and silently ignored if not.
-   Add support to allow allow configure.ac to specify its own
+   Add support to allow configure.ac to specify its own
default, by setting with_openssl_default before invoking gl_INIT.
 
 2013-12-05  Paul Eggert  <egg...@cs.ucla.edu>
@@ -37449,7 +37449,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
(main): Perform test also when getrlimit and setrlimit don't exist or
when setrlimit of RLIMIT_DATA fails (like on Cygwin). Instead of
limiting the address space size using setrlimit, compare the address
-   space size before and after the the test.
+   space size before and after the test.
* tests/test-dprintf-posix2.c: Likewise.
* tests/test-fprintf-posix3.sh: Update skip messages.
* tests/test-dprintf-posix2.sh: Likewise.
@@ -47962,7 +47962,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
* m4/pty_h.m4 (gl_PTY_H_DEFAULTS): Add new witnesses.  Move decl
check...
* m4/pty.m4 (gl_FORKPTY, gl_OPENPTY): ...here.  Request
-   replacement for for non-const BSD signature.
+   replacement for non-const BSD signature.
* modules/pty (Makefile.am): Substitute witnesses.
* lib/pty.in.h (forkpty, openpty): Declare replacements.
* tests/test-forkpty.c: Update signature check.
@@ -48875,7 +48875,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
 
 2010-02-21  Bruno Haible  <br...@clisp.org>
 
-   Really work around around "broken pipe" error message from bash 3.2.
+   Really work around "broken pipe" error message from bash 3.2.
* gnulib-tool (func_reset_sigpipe): Remove function.
(echo): In bash 3.2, define to a function that uses printf.
Analyzed by Ralf Wildenhues, Chet Ramey, Ben Pfaff.
@@ -59038,7 +59038,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
* m4/fclose.m4 (gl_REPLACE_FCLOSE): Likewise.
* m4/open.m4 (gl_REPLACE_OPEN): Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR): Execute AC_LIBOBJ when REPLACE_STRSTR
-   is 1, not only the the first time.
+   is 1, not only the first time.
 
 2009-08-10  Bruno Haible  <br...@clisp.org>
 
@@ -97149,7 +97149,7 @@ o   Test only that noncanonical values do not cause 
crashes, not that
glibc.  No doubt this problem also needs to be handled for glibc
as well, but the result will be an incompatible change to the
glibc ABI, and the old ABI will have to be supported too.  That
-   can be the the subject for another patch.
+   can be the subject for another patch.
 
* lib/regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
governing whether the rest of this patch is active.  By default,
diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex
index 8204f3e3a..3c908e20c 100644
--- a/build-aux/texinfo.tex
+++ b/build-aux/texinfo.tex
@@ -5927,7 +5927,7 @@ end
 }
 
 
-% Finished with with double columns.
+% Finished with double columns.
 \def\enddoublecolumns{%
   % The following penalty ensures t