GNU bug report logs - #24323
"regcomp.c", line 467: error: syntax error before or at: preg

Previous Next

Package: grep;

Reported by: Dennis Clarke <dclarke <at> blastwave.org>

Date: Sun, 28 Aug 2016 03:43:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Dennis Clarke <dclarke <at> blastwave.org>
To: bug-grep <at> gnu.org
Subject: "regcomp.c", line 467: error: syntax error before or at: preg
Date: Sat, 27 Aug 2016 23:40:45 -0400
lib/regcomp.c will not compile with C99 strict compiler because of
the usage of the non-standard "__restrict".

I question the use here of the "restrict" for the purpose of
optimization so I compiled and tested 2.25 both with and without
the "restrict" and there was no measurable difference. The testsuite
passes fully regardless.

We may simply change "__restrict" to the C99 spec clean "restrict" or
remove it entirely with no worries.



--- ./lib/regcomp.c_backup      Sun Apr 10 16:50:01 2016
+++ ./lib/regcomp.c     Sun Aug 28 02:35:43 2016
@@ -464,7 +464,7 @@
    the return codes and their meanings.)  */

 int
-regcomp (regex_t *__restrict preg, const char *__restrict pattern, int 
cflags)
+regcomp (regex_t *restrict preg, const char *restrict pattern, int cflags)
 {
   reg_errcode_t ret;
   reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? 
RE_SYNTAX_POSIX_EXTENDED
@@ -523,7 +523,7 @@
    from either regcomp or regexec.   We don't use PREG here.  */

 size_t
-regerror (int errcode, const regex_t *__restrict preg, char *__restrict 
errbuf,
+regerror (int errcode, const regex_t *restrict preg, char *restrict errbuf,
          size_t errbuf_size)
 {
   const char *msg;




The compiler here was c99 in Oracle Studio 12.5 on Solaris 10 sparc
with strict C99 compliance mode enforced.

Dennis Clarke







This bug report was last modified 8 years and 265 days ago.

Previous Next


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