GNU bug report logs - #77301
Is this a bug?

Previous Next

Package: grep;

Reported by: George R Goffe <grgoffe <at> yahoo.com>

Date: Thu, 27 Mar 2025 06:33:05 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: arnold <at> skeeve.com
To: grgoffe <at> yahoo.com, Dale.Worley <at> comcast.net
Cc: 77301 <at> debbugs.gnu.org
Subject: bug#77301: Is this a bug?
Date: Thu, 27 Mar 2025 10:17:36 -0600
"Dale R. Worley" via Bug reports for GNU grep <bug-grep <at> gnu.org> wrote:

> George R Goffe via Bug reports for GNU grep <bug-grep <at> gnu.org> writes:
> > Apparently the gcc folks have been busy, tightening up the
> > "rules". I'm not sure this isn't one so I'm reporting it.
>
> > pcresearch.c:222:23: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization]
> >   222 |         wprefix[10] = "(?<!\\w)(?:", wsuffix[7] = ")(?!\\w)";
> >       |                       ^~~~~~~~~~~~~
>
> That is strange:  I can't find any statement that recent C standards
> have removed the special case "initialize a char array that doesn't have
> room for the final NULL from a string literal".
>
> Dale

The bug is that the constants given for the sizes are each to small by one.
Count the characters in each string, add 1 for the final '\0', and
you'll see.

Arnold




This bug report was last modified 54 days ago.

Previous Next


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