GNU bug report logs - #34054
Error in compilation of pcresearch if we have no pcre library

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Sun, 13 Jan 2019 00:07:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34054 in the body.
You can then email your comments to 34054 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#34054; Package grep. (Sun, 13 Jan 2019 00:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Sun, 13 Jan 2019 00:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: <bug-grep <at> gnu.org>
Subject: Error in compilation of pcresearch if we have no pcre library
Date: Sun, 13 Jan 2019 09:01:18 +0900
Hi,

I pulled current master of grep from git repository and built it on
fedora 29, and recieved following error.

When we have no pcre library, DIE() in Pcompile and Pexecute is called,
but noreturn attribute is set to their functions.

Thanks,
Norihiro


$ make
......
depbase=`echo pcresearch.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -I../lib -I../lib  -fno-common -W
-Waddress -Waggressive-loop-optimizations -Wall -Wattribute-alias
-Wattributes -Wbad-function-cast -Wbool-compare -Wbool-operation
-Wbuiltin-declaration-mismatch -Wbuiltin-macro-redefined -Wcast-align
-Wcast-align=strict -Wcast-function-type -Wchar-subscripts -Wclobbered
-Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdangling-else
-Wdate-time -Wdeprecated -Wdeprecated-declarations -Wdesignated-init
-Wdisabled-optimization -Wdiscarded-array-qualifiers -Wdiscarded-qualifiers
-Wdiv-by-zero -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond
-Wduplicate-decl-specifier -Wempty-body -Wendif-labels -Wenum-compare
-Wexpansion-to-defined -Wextra -Wformat-contains-nul -Wformat-extra-args
-Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k
-Wformat-zero-length -Wframe-address -Wfree-nonheap-object -Whsa
-Wif-not-aligned -Wignored-attributes -Wignored-qualifiers -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types
-Winit-self -Wint-conversion -Wint-in-bool-context -Wint-to-pointer-cast
-Winvalid-memory-model -Winvalid-pch -Wlogical-not-parentheses
-Wlogical-op -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args
-Wmisleading-indentation -Wmissing-attributes -Wmissing-braces
-Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs
-Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wmultistatement-macros
-Wnarrowing -Wnested-externs -Wnonnull -Wnonnull-compare -Wnull-dereference
-Wodr -Wold-style-declaration -Wold-style-definition -Wopenmp-simd
-Woverflow -Woverlength-strings -Woverride-init -Wpacked -Wpacked-bitfield-compat
-Wpacked-not-aligned -Wparentheses -Wpointer-arith -Wpointer-compare
-Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wpsabi -Wrestrict
-Wreturn-local-addr -Wreturn-type -Wscalar-storage-order -Wsequence-point
-Wshadow -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value
-Wsizeof-array-argument -Wsizeof-pointer-div -Wsizeof-pointer-memaccess
-Wstrict-aliasing -Wstrict-prototypes -Wstringop-truncation -Wsuggest-attribute=cold
-Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=malloc
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsuggest-final-methods
-Wsuggest-final-types -Wswitch -Wswitch-bool -Wswitch-unreachable
-Wsync-nand -Wtautological-compare -Wtrampolines -Wtrigraphs -Wtype-limits
-Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter
-Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs
-Wunused-macros -Wunused-parameter -Wunused-result -Wunused-value
-Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance
-Wvolatile-register-var -Wwrite-strings -Walloc-size-larger-than=9223372036854775807
-Warray-bounds=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5
-Wnormalized=nfc -Wshift-overflow=2 -Wstringop-overflow=2 -Wunused-const-variable=2
-Wvla-larger-than=4031 -Wno-missing-field-initializers -Wno-sign-compare
-Wno-unused-parameter -Wno-cast-function-type -Wno-logical-op
-Wno-format-nonliteral -Werror  -g -O2 -MT pcresearch.o -MD -MP -MF
$depbase.Tpo -c -o pcresearch.o pcresearch.c &&\ mv -f $depbase.Tpo
$depbase.Po

pcresearch.c: In function 'Pcompile':
pcresearch.c:114:1: error: function might be candidate for attribute
'noreturn' [-Werror=suggest-attribute=noreturn]
 Pcompile (char *pattern, size_t size, reg_syntax_t ignored)
 ^~~~~~~~
pcresearch.c: In function 'Pexecute':
pcresearch.c:209:1: error: function might be candidate for attribute
'noreturn' [-Werror=suggest-attribute=noreturn]
 Pexecute (void *vcp, char const *buf, size_t size, size_t *match_size,
 ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:1507: pcresearch.o] Error 1
make[2]: Leaving directory '/home/staff/grep/src'
make[1]: *** [Makefile:1432: all-recursive] Error 1
make[1]: Leaving directory '/home/staff/grep'
make: *** [Makefile:1373: all] Error 2
$ env LC_ALL=C gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,lto
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--with-isl --enable-libmpx --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.2.1 20181215 (Red Hat 8.2.1-6) (GCC)





Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sun, 20 Jan 2019 02:28:01 GMT) Full text and rfc822 format available.

Notification sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
bug acknowledged by developer. (Sun, 20 Jan 2019 02:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 34054-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 34054-done <at> debbugs.gnu.org
Subject: Re: bug#34054: Error in compilation of pcresearch if we have no pcre
 library
Date: Sat, 19 Jan 2019 18:27:02 -0800
On Sat, Jan 12, 2019 at 4:07 PM Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
> I pulled current master of grep from git repository and built it on
> fedora 29, and recieved following error.
>
> When we have no pcre library, DIE() in Pcompile and Pexecute is called,
> but noreturn attribute is set to their functions.
...
> pcresearch.c: In function 'Pcompile':
> pcresearch.c:114:1: error: function might be candidate for attribute
> 'noreturn' [-Werror=suggest-attribute=noreturn]
>  Pcompile (char *pattern, size_t size, reg_syntax_t ignored)

Thank you for the report.
Technically, we could fix it by adding more ifdefs, but I think it
would not be worthwhile to accommodate this use case.

To resolve that, I suggest to install libpcre.
Otherwise, when building without PCRE support, please either avoid the
configure-time --enable-gcc-warnings option or invoke make with the
"WERROR_CFLAGS=" option to suppress -Werror.




Information forwarded to bug-grep <at> gnu.org:
bug#34054; Package grep. (Sun, 20 Jan 2019 18:04:01 GMT) Full text and rfc822 format available.

Message #13 received at 34054 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 34054 <at> debbugs.gnu.org, jim <at> meyering.net, noritnk <at> kcn.ne.jp
Subject: Re: bug#34054: Error in compilation of pcresearch if we have no pcre
 library
Date: Sun, 20 Jan 2019 10:02:41 -0800
[Message part 1 (text/plain, inline)]
Jim Meyering wrote:
> Technically, we could fix it by adding more ifdefs, but I think it
> would not be worthwhile to accommodate this use case.

I looked into this and discovered that fixing this can actually simplify the 
source code by removing the need for the "We can't get here" glitch in 
pcresearch.c. Although the fix does add complexity elsewhere so that the total 
number of ifdefs and ifs remains the same, overall grep gets a bit simpler and 
cleaner with the fix so I took the liberty of installing it (attached).
[0001-grep-simplify-pcresearch.c-ifdefs.patch (text/x-patch, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#34054; Package grep. (Sun, 20 Jan 2019 22:41:01 GMT) Full text and rfc822 format available.

Message #16 received at 34054 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 34054 <at> debbugs.gnu.org, Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Subject: Re: bug#34054: Error in compilation of pcresearch if we have no pcre
 library
Date: Sun, 20 Jan 2019 14:39:36 -0800
On Sun, Jan 20, 2019 at 10:03 AM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Jim Meyering wrote:
> > Technically, we could fix it by adding more ifdefs, but I think it
> > would not be worthwhile to accommodate this use case.
>
> I looked into this and discovered that fixing this can actually simplify the
> source code by removing the need for the "We can't get here" glitch in
> pcresearch.c. Although the fix does add complexity elsewhere so that the total
> number of ifdefs and ifs remains the same, overall grep gets a bit simpler and
> cleaner with the fix so I took the liberty of installing it (attached).

Nice. Thanks for taking the time to move-"up" and reduce the complexity.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Feb 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.