bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Arsen Arsenović
Subject: Re: groff with "nullptr" and (without) gnulib module causes error
Date: Wed, 08 Feb 2023 21:14:50 +0100

Hi Bjarni,

Bjarni Ingi Gislason <bjarniig@simnet.is> writes:

> 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

This code is simply not valid code ;)  I suspect the intended code here
is just *p != 0 based on looking at it briefly.

The type of *p is const char, as the error message states, which is not
comparable with std::nullptr_t, because its express purpose is to remove
integral-pointer coercion error.

Changing this to be a zero rather than nullptr results in a successful
build of master on my end.

> ####
>
> "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
>  "

Have a great night.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

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